Posted: 2010-02-17 00:06
I have created a VBScript to upload my files from Windows XP/Sp3 to the secure server.
This is the code in my script:
Set objShell = CreateObject("WScript.Shell")
objShell.Run """C:\Program Files\WinSCP3\WinSCP.com""" & "/"&command &" option confirm off " & "option batch on " & "option transfer ascii " & "open " & " sftp:user_name:myPassword@ftp.host:22" &" put "& "S:\CashNet\balance.dat " &"/" & files & "/" & "exit"
'sftp://watc_prod:1bWnMH1TvQ@ftp.cashnet.com put & ""S:\CashNet\balance.dat"" & /files/ exit"
Set objShell = Nothing
When I execute the script, the dos window displays these messages:
Searching for host
Host not found
I checked the http://winscp.net/eng/docs/message_host_does_not_exist page, but both examples are the same.
Per the security administrator, I should be able to access any external site from my computer.
I can take the command in the objShell.Run statement, remove the ampersands and extra quotes and run it successfully from the start/run line.
Location: Prague, Czechia
I do not know VBScript good enough. Though I belive that you syntax is wrong.
- What is in "command" variable? There has to be a "command" string, otherwise your code won't work. But I do not understand why you use variable for that.
- Also you do not enclose the individual commands to quotes.
- There's no space before exit command.
You can post new topics in this forum
And it's free!