start /wait does not wait :-(

  • Thread starter Thread starter Yandos
  • Start date Start date
Y

Yandos

Hi,

I've been asking for help on xp-general group, but without luck, so I'm trying it here...

I have the batch file which is executed every half an hour on a server (win2003) to do some backups:

-----8<-----
@echo off
echo compress1
C:\WINDOWS\system32\cmd.exe /c start "zip" /wait /b /low "C:\Program Files\7-Zip\7z.exe" a -t7z "-
m0=PPMd" "-mmem=32m" "-mo=8" "-mhe=on" -- backup1.7z "c:\dir1\*.*"
echo compress2
C:\WINDOWS\system32\cmd.exe /c start "zip" /wait /b /low "C:\Program Files\7-Zip\7z.exe" a -t7z "-
m0=PPMd" "-mmem=32m" "-mo=8" "-mhe=on" -- backup2.7z "c:\dir2\*.*"
ping 127.0.0.1 -n 100
echo do something...
pause
-----8<-----

7z.exe (compress program) eats too much cpu, so I need to run it as a low priority task to preserve
computer response for other tasks. It is executed as a low priority task, BUT it does not wait for
7z.exe's end. What's wrong with my batch?

Thank you in advance.

Y.
 
Yandos said:
Hi,

I've been asking for help on xp-general group, but without luck, so I'm trying it here...

I have the batch file which is executed every half an hour on a server (win2003) to do some backups:

-----8<-----
@echo off
echo compress1
C:\WINDOWS\system32\cmd.exe /c start "zip" /wait /b /low "C:\Program Files\7-Zip\7z.exe" a -t7z "-
m0=PPMd" "-mmem=32m" "-mo=8" "-mhe=on" -- backup1.7z "c:\dir1\*.*"
echo compress2
C:\WINDOWS\system32\cmd.exe /c start "zip" /wait /b /low "C:\Program Files\7-Zip\7z.exe" a -t7z "-
m0=PPMd" "-mmem=32m" "-mo=8" "-mhe=on" -- backup2.7z "c:\dir2\*.*"
ping 127.0.0.1 -n 100
echo do something...
pause
-----8<-----

7z.exe (compress program) eats too much cpu, so I need to run it as a low priority task to preserve
computer response for other tasks. It is executed as a low priority task, BUT it does not wait for
7z.exe's end. What's wrong with my batch?
The cmd.exe /C creates a _NEW_ shell which exeutes the start "zip" etc.
detached.
The new shell will wait, but there is no follow up.

The batch itself has nothing to wait for.

Simply remove the "cmd.exe /C" part.
 
Hi,

I've been asking for help on xp-general group, but without luck, so I'm trying it here...

I have the batch file which is executed every half an hour on a server (win2003) to do some backups:

-----8<-----
@echo off
echo compress1
C:\WINDOWS\system32\cmd.exe /c start "zip" /wait /b /low "C:\Program Files\7-Zip\7z.exe" a -t7z "-
m0=PPMd" "-mmem=32m" "-mo=8" "-mhe=on" -- backup1.7z "c:\dir1\*.*"
echo compress2
C:\WINDOWS\system32\cmd.exe /c start "zip" /wait /b /low "C:\Program Files\7-Zip\7z.exe" a -t7z "-
m0=PPMd" "-mmem=32m" "-mo=8" "-mhe=on" -- backup2.7z "c:\dir2\*.*"
ping 127.0.0.1 -n 100
echo do something...
pause
-----8<-----

7z.exe (compress program) eats too much cpu, so I need to run it as a low priority task to preserve
computer response for other tasks. It is executed as a low priority task, BUT it does not wait for
7z.exe's end. What's wrong with my batch?

Thank you in advance.

Y.

Try it without "C:\WINDOWS\system32\cmd.exe /c"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top