
For example this works, and, again, the only thing c:\test\ftp.txt is doing is issue a dir command.įTP = WShell.Run("ftp -s:c:\test\ftp.txt") I can take out the redirect from the shell command, and the vbscript performs as would be expected. My issue here is that when I try to direct the results of 'dir' to a local text file, something is causing it to not work. I should have clarified that I am able to FTP files using VBScript, i.e. I believe it must be something simple I am overlooking. I have tried setting a variable equal to the string between the quotes to no avail, and have tried setting various parts as variables, but no success. Very simple, but does not behave the same as when I type directly in the command prompt. Set WShell = CreateObject("WScript.Shell")įTP = WShell.Run("ftp -s:c:\test\ftp.txt>c:\test\ftp_out.txt") This is how I am trying to run it in vbscript. However, if I try to run from a vbscript, it only flashes the command window for a split second, then stops.

Below are the lines in c:\test\ftp.txt (host, user, pass changed to protect the innocent) The only thing c:\test\ftp.txt is doing is downloading dir contents to text file c:\test\ftp_out.txt.

If I run "ftp -s:c:\test\ftp.txt>c:\test\ftp_out.txt" (without the quotes) from the command prompt, it works like a charm.

I am trying to get a vbscript to run ftp command.
