Both OS/2 and NT offer a way to create your own one-time single-line "batch files" from the command line:
||Execute command2 after execution of command1 has finished||
||Execute command2 only if execution of command1 has finished successfully||
||Execute command2 only if execution of command1 has finished unsuccessfully||
FORMAT A: /Q && COPY C:\DATA\*.* A:
will copy all files from C:\DATA to diskette IF and ONLY IF the format succeeds.
XCOPY C:\*.* D:\ /S 2>&1> NUL || ECHO Something terrible happened
will display your own custom error message if XCOPY fails.
|page last uploaded: 23 November 2011, 19:49|