View Full Version : Batch file Help
sammy004
08-02-07, 04:47 AM
Hi guys I was wondering if anyone can help me out. I need to make a batch file that will repeat the DOS comand dir /s. The reason I wanna do this is because I can stress test some PC's by opening up a number of this batch file and put a load on the CPU. I just dont know how I can repeat the batch file so if anyone can help me out it would be greatly appriciated.
Thank You
Sammy
dog2525
08-02-07, 05:33 AM
well when it comes to this stuff i am clueless, but you could use a program prime 95 to stress out the computer.
dog2525 raises a good point - if stress loading/testing is all you want, there are lots of small but potent programs out there already which are free, designed for just that.
But, you asked, so... to repeatedly call a batch file command, you're going to want to control the flow of the script, probably through some kind of conditional loop or recursive function. I mean, you can set up an infinite 'loop' quite simply:
:mark
dir /s
goto mark
but obviously that's not great. You can introduce an if statement to provide a condition:
set i=0
:loop
set /a i=i+1
if (i)==(1000) goto end
dir /s
goto loop
:end
However, you may want a for loop or whatever - get Googling on DOS batch file commands!
jdrom17
08-02-07, 12:54 PM
Yeah, use Prime95 or Orthos. Much easier and more effective at stressing the CPU. It'll put it at 100%.
I just ran dir /s and it really did nothing to my CPU load.
EDIT: Running the above:
:mark
dir /s
goto mark
Still only gives about 50% CPU load on each core.
I'm surprised it worked at all - my head is still spinning from last night! ;)
Uhm, if you're running dual core, open up two dir /s CMDs. i.e. call the batch file twice - that should 100% it.
Edit/ NB: Of course, this is hardly using system RAM much, and some parts of the CPU (e.g. FPU) will be being under-utilised.
sammy004
08-03-07, 12:14 AM
hey thanks guys for the info I was working on it last night and used the loop feature to loop the dir /s command. but I will give the other programs a try.
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.