Link to home
Start Free TrialLog in
Avatar of jeff1946
jeff1946

asked on

Run A Command At Low Priority - Start /Wait Doesn't Work?

On WinXP SP3 I want to run a couple of ROBOCOPY.EXE commands one after the other at low priority in a CMD script. If I use the START command to set the priority like this

START "ROBO C" /WAIT /LOW /B ROBOCOPY.EXE C:\ H:\ROBO\C /E /Z /NP /PURGE /R:0 /W:0
START "ROBO D" /WAIT /LOW /B ROBOCOPY.EXE D:\ H:\ROBO\D /E /Z /NP /PURGE /R:0 /W:0

then the ROBOCOPYs run concurrently despite the /WAIT option. Does anyone know either (a) why my /WAIT option doesn't work and how to fix it or (b) another way to run the ROBOCOPY commands at low priority?

Thanks in advance....
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeff1946
jeff1946

ASKER

Steve,

Thanks for your quick and effective answer. That certainly seems to fix the problem, although it litters my console with extra Command-Prompt windows. I hope they go away when I run the script as a scheduled task!

Bonus question: Is there any other way to run a command at reduced priority?
Yes, it got me the first time I used it!  If you want them to run concurrently any reason why you don't just add them to a batch file btw then START that, i.e.

START /MIN /WAIT /LOW cmd /c yourbatch.cmd

@echo off
REM yourbatch.cmd
ROBOCOPY.EXE C:\ H:\ROBO\C /E /Z /NP /PURGE /R:0 /W:0
ROBOCOPY.EXE D:\ H:\ROBO\D /E /Z /NP /PURGE /R:0 /W:0

I don't know another way offhand, always use START, sorry.

Thanks for the points etc.

Steve
Steve,

I didn't think of that, but it's a much more elegant solution -- thanks!

Jeff