0

I have a scheduled task using Windows 7 to run a .exe file at a specific hour, which in-turn creates a .txt file and saves it in a folder. I am trying to write a script that will automatically send this .txt file to a FTP server without me using cmd.

I am working with this script thus far

open ftp.site.com
username
password
put c:\folder\file.txt
quit
Martin Prikryl
  • 147,050
  • 42
  • 335
  • 704

2 Answers2

0

FTP doesn't require CMD. It can run in it's own console window.

FTP /? shows

  -s:filename     Specifies a text file containing FTP commands; the
                  commands will automatically run after FTP starts.

The script file contains exactly what you would type interactivly.

0

Supposing your current scheduled task runs a command like:

c:\folder\someapp.exe c:\folder\file.txt

Change that to

c:\folder\script.bat

Where the c:\folder\script.bat batch file will look like:

c:\folder\someapp.exe c:\folder\file.txt
ftp.exe -s:c:\folder\ftp.txt

And the c:\folder\ftp.txt will contains your FTP script:

open ftp.site.com
username
password
put c:\folder\file.txt
quit
Martin Prikryl
  • 147,050
  • 42
  • 335
  • 704