aveerara
02-26-2004, 01:31 PM
I want to automate a process that we perform every month, compressing certain files in a specific folder (using winzip right now) and deleting those files. I am currently looking into using WSH to automate that task. I am new to windows scripting.
Currently, at someone else's idea, I am planning on using the Exec function to run winzip command line utility. I have the code, but it doesn't work completely.
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("wzzip "Path where I want the zip file to be\test.zip" "Path to the folder where te zip files to be zipped are"")
When I just say the zipfile name, it puts the destination on the desktop. I need the destination to be at one particular path. Also, I tried to cd to that path using another Exec command, but it doesn't work. It gives me an error. Help please.
Note: There are three sets of quotes. One around the entire command, one around the destination file and the third around the source file. I tried various combinations with and without double and single quotes. None works.
Note 2: Apparently, the script doesn't recognize the multiple quotes used. Is there any way around that?
If it is not possible to achieve this project this way, is there a better way of doing this?
I am not particular about the winzip app. I can change it if it is easier with any other compression utility. Thanks in advance.
Currently, at someone else's idea, I am planning on using the Exec function to run winzip command line utility. I have the code, but it doesn't work completely.
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("wzzip "Path where I want the zip file to be\test.zip" "Path to the folder where te zip files to be zipped are"")
When I just say the zipfile name, it puts the destination on the desktop. I need the destination to be at one particular path. Also, I tried to cd to that path using another Exec command, but it doesn't work. It gives me an error. Help please.
Note: There are three sets of quotes. One around the entire command, one around the destination file and the third around the source file. I tried various combinations with and without double and single quotes. None works.
Note 2: Apparently, the script doesn't recognize the multiple quotes used. Is there any way around that?
If it is not possible to achieve this project this way, is there a better way of doing this?
I am not particular about the winzip app. I can change it if it is easier with any other compression utility. Thanks in advance.