Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

batch file

Status
Not open for further replies.

apocalypse11

Technical User
Jan 11, 2001
77
0
0
AU
Hi,

I have a batch file that calls on winzip to zip files every hour. I noticed that in the processes tab in task manager, i'm now getting a whole lot of cmd.exe and winzip.exe processes. How do i stop these processes once the batch file has finished?

Thanks...
 
Post the batch file here.


____________________________
Users Helping Users
 
The batch file is:

<start>
"C:\Program Files\WinZip\winzip32" -min -m "c:\backup\belvoirsql\Belvior.zip" "c:\backup\belvoirsql"
<end>

I am guessing that if i just add "exit" to the end it will solve the cmd.exe process; however, how about the winzip process?

Thanks..
 
I've never used winzip from the command line, but it looks to me like you're creating the equivalent of an endless loop. If I'm reading this correctly: Belvoir.zip is the file being created. It's being created in the belvoirsql folder. belvoirsqul is the folder being zipped.
 
if the Exit command does not solve your problem you might want to look into "Taskkill" (only for W2K & XP i think)
 
I vote with smah.

You would think it would throw an error though because Belvoir.zip was an open file.

I also wonder about "-m" for move instead of -f for freshen, or -u for update which would be much faster.


____________________________
Users Helping Users
 
Just out of curiosity, how many files are in the c:\backup\belvoirsql folder and what size are the files? Also, are there subfolders?
 
There are 4 files, total size of approx 500Mb... No subfolders. I tried exit after the batch job and both processes still remain. I also tried "-m" and "-f", and "-u" for the winzip options. It does speed things up but the processes don't terminate once the job completes.

thanks..
 
You may want to try the WinZip command line support add-on. With this and the exit command in the batch file, your problem should be solved.


wzcline11 is for WinZip 9 wzcline20 is for WinZip 10
 
First, MD C:\backup\belvoirsql\ZIPS

Second, (one time only):
move c:\backup\belvoirsql\belvior.zip c:\belvoirsql\ZIPS

Third, edit the .bat file:
;<start>

"C:\Program Files\WinZip\winzip32" -min -u "c:\backup\belvoirsql\ZIPS\Belvior.zip" "c:\backup\belvoirsql"

goto :EOF

;<end>




____________________________
Users Helping Users
 
I will sheepishly admit I didn't know after all this time that WinZip32 supported parameters, hence my post about the command line add-on :~/

I too was curious about the smah's point about "creating the equivalent of an endless loop". I created a CMD file with the line:

"C:\Program Files\WinZip\wzzip" -min -m d:\temp\junk.zip d:\temp

No errors are thrown, the zip is created with all files from d:\temp, excluding the zip file itself, and all files are then deleted (moved) once done, and no cmd.exe or winzip32 remains active. I tried this with files of various sizes, including 4 files of 580MB each.

If I invoke the batch numerous times before the prior instance(s) finish, I do get multiple cmd.exe and winzip32.exe processes in Task Manager. However, I get error dialog boxes from WinZip onscreen. Once I respond to these the processes are terminated as expected.

Tests were performed with WinZip 9.0 SR-1
 
hello everyone... thanks for your help. just one more question. when winzip finds no files to zip - how can i make it ignore and close? it wants me to click on a window to acknowledge the message when it can't find any files to zip.

any help would be appreciated..
 
Do if exist branching.

. For folders:
You cannot use the if command to test directly for a directory, but the null (NUL) device does exist in every directory. As a result, you can test for the null device to determine whether a directory exists. The following example tests for the existence of a directory:

Example of a folder test:
if exist c:\belvoirsql\ZIPS\nul goto process

. For files:
Example:
c:\backup\belvoirsql\ZIPS\Belvior.zip

================= Full example
; if the belvoir.zip file exists, call winzip to freshen
; else exit

IF EXIST c:\backup\belvoirsql\ZIPS\Belvior.zip GOTO ZIPIT
GOTO EOF

:ZIPIT

"C:\Program Files\WinZip\winzip32" -min -u "c:\backup\belvoirsql\ZIPS\Belvior.zip" "c:\backup\belvoirsql"




____________________________
Users Helping Users
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top