Windows Batch Scripting/Interactive Commands

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Interactive Commands[edit | edit source]

This chapter covers the following commands:

  • CLS - Clears the screen.
  • COLOR - Sets the default console foreground and background colors.
  • DOSKEY - Edits command lines, recalls Windows commands, and creates macros.
  • HELP - Provides Help information for Windows commands.
  • PROMPT - Changes the Windows command prompt.
  • TITLE - Sets the window title for a CMD.EXE session.

The COLOR COMMAND[edit | edit source]

The COLOR command sets the default console foreground and background colors.

The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute the COLOR command with a foreground and background color that are the same.

D:\wikibooks>COLOR 00

D:\wikibooks>echo %ERRORLEVEL%
1

D:\wikibooks>
Using the COLOR command.