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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Varables

Status
Not open for further replies.

GRonken

Programmer
Oct 30, 2003
26
0
0
US
In a VBS I want to substitute the following characters "mytestzipname" with a variable. Can/HOW do I do this? The following works just fine, making a zip file called mytestzipname.zip file.

Set Shell = CreateObject("WScript.Shell")
Shell.Run "WZZIP C:\DATA\FTP\ARI\mytestzipname.ZIP C:\DATA\FTP\ARI\*.*"
 
myTestVar="mytestzipname.ZIP" 'can be anything - also consider path as varname to handle changes

Set Shell = CreateObject("WScript.Shell")
Shell.Run "WZZIP C:\DATA\FTP\ARI\myTestVar C:\DATA\FTP\ARI\*.*"

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
I did that BUT the file name became 'Filename.zip' How do I pass in a varible?

Shell.Run "WZZIP C:\DATA\FTP\ARI\Filename C:\DATA\FTP\ARI\*.*"
 
Try something like this:
Filename="mytestzipname"
Set Shell = CreateObject("WScript.Shell")
Shell.Run "WZZIP C:\DATA\FTP\ARI\" & Filename & ".ZIP C:\DATA\FTP\ARI\*.*"

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I have tried this and it returns a "Expected an end of statement" error. Is their anothe rapproach I should/could be looking at? HELP!!!
 
Can you post the exact code you tried and the whole error message ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top