Search code examples
batch-filecmdpause

Pause command parameters in CMD/BATCH?


Does the Pause command in CMD have parameters? I know that adding >nul to it makes it not give off the message but has the same effect, also it is not a parameter and does the same/similar thing for other commands. The documentation (found by typing pause /?) doesn't show any parameters, suggesting that there are no other ones. Despite this, are there any?


Solution

  • The pause command doesn't have any arguments, options or switches, except /?.

    Type pause /? into a command prompt window and read the help text:

    Suspends processing of a batch program and displays the message
        Press any key to continue . . .
    

    Any > nul or < nul part prepended or appended to pause or to any other command is called redirection:

    • nul is the so-called Null device that can be used to suppress display messages or to retrieve empty input;
    • the > operator redirects the console standard output of a command to somewhere; so > nul suppresses the display text (like Press any key to continue . . .);
    • the < operator redirects the console standard input of a command to somewhere; so < nul replaces the keyboard input by nothing, so the command does not wait for user input;