doser
asked on
Pass DOS/Batch Variables to VBScript
I am trying to pass a variable that I created in a batch file over to a VBScript. In the batch file, I have a filename that the VBScript will use to call an FTP program to upload. I have the following in the batch file:
Wscript upload.vbs SOMEFILE.zip
In my VBScript, I have this so I can at least see that the value is passed along:
Dim file_name
Set file_name = WScript.Arguments("0")
WScript.Echo "file_name"
I want the VBScript to take the value in "file_name" and use that to upload the specified file. I'm really looking to get this part fixed so I can get it out of my head. Any help is appreciated. Thanks.
Wscript upload.vbs SOMEFILE.zip
In my VBScript, I have this so I can at least see that the value is passed along:
Dim file_name
Set file_name = WScript.Arguments("0")
WScript.Echo "file_name"
I want the VBScript to take the value in "file_name" and use that to upload the specified file. I'm really looking to get this part fixed so I can get it out of my head. Any help is appreciated. Thanks.
Second thought is - specify the full path...probably not the problem, but can't hurt.
cscript c:\pathtofile\upload.vbs c:\pathtootherfile\SomeFil e.zip
cscript c:\pathtofile\upload.vbs c:\pathtootherfile\SomeFil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Set file_name = WScript.Arguments(0)
(without quotes)