CMD Syntax & Customization

Enable/Disable Command Extensions for Command Prompt

Regedit :
Key: Software\Microsoft\Command Processor
Name: EnableExtensions
Value: 1 enable
Value: 0 disable

Turn on Quick Edit

  • Right-click the CMD Window Title Bar
  • Select “Properties”
  • Select “Quick Edit Mode”
    • Copy by Highlighting & hitting Enter
    • Paste by right-clicking
  • You can also change the background colors, etc here


  • CMD [charset] [options] [My_Command]


  • /C Carries out My_Command and then terminates
  • /K Carries out My_Command but remains
  • My_Command : The command, program or batch script to be run. This can even be several commands separated with ‘&’ (the whole should also be surrounded by “quotes”)
  • /T:fg Sets the foreground/background colours
  • /X Enable extensions to CMD.EXE
  • /Y Disable extensions to CMD.EXE


  • /A Output ANSI Characters
  • /U Output UNICODE Characters
    These 2 swiches are useful when piping or redirecting to a file Most common text files under WinNT are ANSI, use these switches  when you need to convert the character set.


  • /D Ignore registry AutoRun commands
    • HKLM | HKCU \Software\Microsoft\Command Processor\AutoRun
  • /F:ON Enable auto-completion of pathnames entered at the CMD prompt
  • /F:OFF Disable auto-completion of pathnames entered at the CMD prompt (default)

At the command prompt Ctrl-D gives folder name completion and Ctrl-F gives File and folder name completion.

These key-strokes will display the first matching path. Thereafter, repeated pressing of the same control key will cycle through the list of matching paths. Pressing SHIFT with the control key will move through the list backwards.

  • /Q Turn echo off
  • /S Strip quote characters from the command_line
  • /V:ON Enable delayed environment variable expansion this allows a FOR loop to specify !variable! instead of %variable% expanding the variable at execution time instead of at input time.
  • /V:OFF Disable delayed environment expansion.

Environment expansion preference can be set permanently in the registry
HKLM | HKCU \Software\Microsoft\Command Processor\DelayedExpansion
Set to either 0x1 or 0x0

  • /knetdiag /debug
  • /knetdiag /fix

The knetdiag switches are undocumented and work in XP only
they list and (may) fix these networking issues.

If /C or /K is specified, then the remainder of the command line is processed as an immediate command in the new shell. Multiple commands separated by the command separator ‘&&’ are accepted if surrounded by quotes

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s