Using a Batch File

Note: You cannot run two batch files at the same time.

Instead of typing the command at the command prompt, you may find it more expedient to enter the command line into a batch file (a text file with the file extension .bat). This makes it easier to correct mistakes and to run the same command again.

You run the command by invoking the .bat file at the command prompt, double-clicking the icon for the .bat file from within Windows, or running the .bat file from another application (such as WS_FTP Scheduler).

Here is a batch file (for the example at the beginning of this chapter) as viewed from a Windows text editor:

When you run the batch file named tartan.bat, WS_FTP uploads the tartan.bmp file to the border FTP site.

Note that using a batch file involves placing the command name wsftppro at the beginning of each line in the file. Since each instance of the command name starts the WS_FTP application (and connects to the remote site), you would only use a batch file to work with one command at a time. If, on the other hand, you want to issue a group of commands, follow the procedure in Multiple Folders or Commands.

Remember that if a file name has a space in it, you must enclose that entire argument in quotes.