Contents |
Use labels for comments, as REM is an actual command and may impede performance. A double colon can signify a comment to avoid confusion with actual labels:
:: This is a comment REM This is a comment that requires executing a command
@start /b \path\to\program argument
nircmd exec hide something.bat
someprogram.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
(so stupid)
Execute two commands, regardless of errors:
echo awe & echo some
Execute first command, and second command if no error:
dir \somewhere >nil 2>&1 && echo \somewhere exists
Execute first command, and second command if error:
dir \somewhere >nil 2>&1 || echo An error occurred
Redirect output to hell
C:\>echo svin >nul
set VARIABLE=value echo %VARIABLE%