DOSCMD        Execute an internal MS-DOS command

Top  Previous  Next

Syntax:

DOSCMD

[ cmd ]

Arguments:

[ cmd ]

Variable or string defining an MS-DOS command such as dir, copy, mkdir, etc. to be executed.

Options:

None

 

 

 

This script command executes a specified MS-DOS internal command. Robo-FTP is suspended until the execution of the command is complete.

 

Consider the following example that lists the contents of the current folder to a file.

 

DOSCMD "dir *.* > tempfile"

 

Consider the following example where a new folder is created and the contents of the current folder is copied there.

 

DOSCMD "mkdir \newfolder"

DOSCMD "copy *.* \newfolder"

 

Upon return, any exit code from the process launched with DOSCMD is saved in the %lasterror script variable and can be tested with any of the IFERRORcommands. For example:

 

DOSCMD "fc file1.txt file2.txt"

;; ‘fc’ returns 2 if it cannot compare the specified files

IFERROR= 2 GOTO fc_error

 

Related Command(s): CALL, CHAIN , EXEC

See also: Script File Result Codes