never mind. got it
if anyone will benefit from this (and doesn't know how to), here's what I did
From VBS, it seems impossible to run an WinSCP script that resides in a txt file. Therefore this will not work:
Dim wshShell
Set wshShell = WScript.CreateObject("WScript.Shell")
wshShell.Run("WinSCP3.exe secureSFTP /console /script=fsftp.txt"),1,True
Putting the above code in a bat file and trying to execute the bat file from VBS had the same issue. I tried several techniques but none worked, until this
Dim wshShell
Dim sftpcmd
Set wshShell = WScript.CreateObject("WScript.Shell")
sftpcmd = "WinSCP3 secureSFTP /console /command " & """option batch on""" & " " & """option confirm off""" & " " & """cd /Dex""" & " " & """option transfer binary""" & " " & """get securefile.txt.pgp C:\\SecureFileDump\\Archive\\""" & " " & """close""" & " " & """exit"""
wshShell.Run(sftpcmd),1,true
wscript.sleep(10000) 'wait for 10 seconds until sftp is done
Maybe this is not a big thing, but I thought I'd put it up here for someone's benefit
Thanks
Leo
Leo wrote:
So I am trying to run a command on WinSCP from VBS, but it does not run. Is there a way to accomplish this?
see, when it tries to run the txt file, it closes. Is there a way to make it wait? How can I do this?
Thanks
Leo