Getting >nul 2>&1 to work within a batch file
Posted: 27 Oct 2018 17:48
How do I get the following command to work from within a batch file?
I want the output of taskkill to be suppressed. It works perfectly if typed at the command line, but when the above command is used in a batch file, you still see the output text from taskkill.
I am aware that commands behave differently when called from a batch file rather than when they're run directly, but I can't remember what needs to be done to modify the command for use in a batch file.
Code: Select all
doskey closeall=taskkill /IM "cmd.exe" /f >nul 2>&1
I am aware that commands behave differently when called from a batch file rather than when they're run directly, but I can't remember what needs to be done to modify the command for use in a batch file.