Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
doscmd_with_spaces.s
The trick to using DOSCMD with file and folder names that contain spaces is to use single quotes as string delimiters for the purposes of your Robo-FTP command script and double quotes for the values actually passed to DOS.
1 ; make two folders with spaces in the name
2 MAKEDIR "c:\A nice folder"
3 MAKEDIR "c:\A junk folder"
4
5 ; make two files in one of the folders
6 WRITEFILE "c:\a nice folder\file1.txt" "first test file"
7 WRITEFILE "c:\a nice folder\file2.txt" "second test file"
8
9 ; make a string that contains the DOS command
10 ; note the outer single quotes and inner double quotes
11 SET cmd = 'COPY "c:\A nice folder\*.txt" "c:\A junk folder\"'
12
13 ; run the DOS command
14 DOSCMD cmd
15
16 ; verify the file1.txt file exists in both folders
17 GETNEXTFILE "c:\a nice folder\file1.txt"
18 GETNEXTFILE "c:\a junk folder\file1.txt"
19
20 ; verify the file2.txt file exists in both folders
21 GETNEXTFILE "c:\a nice folder\file2.txt"
22 GETNEXTFILE "c:\a junk folder\file2.txt"