Hi,
I need to execute an exe file, but I do not know how to do it, Can you help me?, I have the following code:
Sub ZipCompress(ZipFile,FilesToZip)
'ZipFile = Path and filename for the zipped file
'FilesToZip = List of files to zip
Parameters ="[-min] -a " + ZipFile + " " + FilesToZip
Execute "C:\Program Files\Winzip\WINZIP32.EXE" Parameters
End Sub
How can I fix it?
Thanks,
Salvador Hernandez
How to execute an "exe" file
Moderators: JRL, Dorian (MJT support)
How to execute an "exe" file
Thanks,
Salvador Hernandez
Salvador Hernandez
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
This looks like a mix of VB and Macro Scheduler.
If you want to run a command to zip files from Macro Scheduler, then you need the command utilities from Winzip. That is available at http://www.winzip.com/wzcline.cgi If you have those, then you can create a line in your Macro Scheduler script that looks something like this:
If you want to run a command to zip files from Macro Scheduler, then you need the command utilities from Winzip. That is available at http://www.winzip.com/wzcline.cgi If you have those, then you can create a line in your Macro Scheduler script that looks something like this:
You can use variables for the parameters as shown here, or just enter them hard coded. See the WZCLINE.HLP file for more info on the option switches available with the WinZip command line utility.Let>RP_WAIT=1
Let>Options=-a -k
Let>ZipFile=c:\test.zip
Let>SourceFiles=*.txt
//The next line adds all files with a .txt extension to the Zip file test.zip, keeping the original date.
Run Program>C:\Program Files\Winzip\wzzip %Options% %ZipFile% %SourceFiles%
Let>RP_WAIT=0
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
How to execute an "exe" file from inside a VBScrip
Hi Bob,
Thanks for your help, but I was using the winzip application as an known example, but what I'm looking for is to call an "exe" program, with parameters, from inside a VBScript sub module, without Macro Scheduler commands, Do you know how to do it?
Thanks,
Salvador Hernandez
Thanks for your help, but I was using the winzip application as an known example, but what I'm looking for is to call an "exe" program, with parameters, from inside a VBScript sub module, without Macro Scheduler commands, Do you know how to do it?
Thanks,
Salvador Hernandez
Thanks,
Salvador Hernandez
Salvador Hernandez
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:

See how close this works for you shamigc:
Note: This is an untested quick and dirty thought......VBSTART
Sub ZipCompress(ZipFile,FilesToZip)
'ZipFile = Path and filename for the zipped file
'FilesToZip = List of files to zip
dim strParameters as String
Parameters ="[-min] -a " + ZipFile + " " + FilesToZip
Execute "C:\Program Files\Winzip\WINZIP32.EXE" strParameters
End Sub
VBEND
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
How to run an "exe" from VBScript
Bob,
Thanks, I found how to do it, this is the way:
--------------------------------
VBStart
Sub Principal
set oShell=createobject("WScript.Shell")
Set oProc=oShell.Exec("C:\Program Files\Winzip\WINZIP32.EXE -min -a C:\Temp\Prueba.zip D:\TextAloud\*.mp3")
End Sub
VBEnd
VBRun>Principal
-----------------------------------------
Bye,
Salvador Hernandez
Thanks, I found how to do it, this is the way:
--------------------------------
VBStart
Sub Principal
set oShell=createobject("WScript.Shell")
Set oProc=oShell.Exec("C:\Program Files\Winzip\WINZIP32.EXE -min -a C:\Temp\Prueba.zip D:\TextAloud\*.mp3")
End Sub
VBEnd
VBRun>Principal
-----------------------------------------
Bye,
Salvador Hernandez
Bob Hansen wrote:Real quick thought is that you may only need to declare your Parameters.
See how close this works for you shamigc:Note: This is an untested quick and dirty thought......VBSTART
Sub ZipCompress(ZipFile,FilesToZip)
'ZipFile = Path and filename for the zipped file
'FilesToZip = List of files to zip
dim strParameters as String
Parameters ="[-min] -a " + ZipFile + " " + FilesToZip
Execute "C:\Program Files\Winzip\WINZIP32.EXE" strParameters
End Sub
VBEND
Thanks,
Salvador Hernandez
Salvador Hernandez
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact: