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....
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
Steve,
I didn't think of that, but it's a much more elegant solution -- thanks!
Jeff
I didn't think of that, but it's a much more elegant solution -- thanks!
Jeff
ASKER
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?