TechSapphire Thursday, 2024-04-25, 4:46 PM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Command Processor

    1. Disable the MS-DOS Command Prompt (Windows 95/98/Me)
    This setting allows you to disable the use of the MS-DOS command prompt in Windows.

    Create a new DWORD value, or modify the existing value, named "Disabled" and set it to "1" to disable the command prompt or to re-enable it again later change the value to "0".

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp]
    System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp]
    Name: Disabled
    Type: REG_DWORD (DWORD Value)
    Value: (0 = disable, 1 = enable)

    2. Enable Command Completion (Windows NT/2000/XP)
    Command completion allows you to type a portion of a file name, and then have the system complete the rest by pressing the specified key. This is similar to the UNIX shell command completion feature.

    Create a new DWORD value, or modify the existing value, called 'CompletionChar' and set it to equal the hex value of the required control character. For example to use the TAB key set the value to '9', to use BackSpace set the value to '8', to use Ctrl-D set the value to '4' and for Ctrl-F set the value to '6'.

    Exit your registry, you may need to restart Windows for the change to take effect.

    Now when you type the first part of a filename then press the specified key, Windows will complete the filename for you. Pressing the key multiple times will scroll through all the options.

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]
    Name: CompletionChar
    Type: REG_DWORD (DWORD Value)
    Value: Hex Control Character

    3. Change the Command Prompt (Windows NT/2000/XP)

    This setting allows you to change the format of the command prompt to show additional information instead of just the current drive and path ("C:\>").

    Open your registry and find the key below.

    Create or modify a REG_EXPAND_SZ string called "PROMPT" and set it to the required prompt format including any special codes or variables below.

    Special Codes

  • $A - & (Ampersand)
  • $B - | (pipe)
  • $C - ( (Left parenthesis)
  • $D - Current date
  • $E - Escape code (ASCII code 27)
  • $F - ) (Right parenthesis)
  • $G - > (greater-than sign)
  • $H - Backspace (erases previous character)
  • $L - < (less-than sign)
  • $N - Current drive
  • $P - Current drive and path
  • $Q - = (equal sign)
  • $S - (space)
  • $T - Current time
  • $V - Windows XP version number
  • $_ - Carriage return and linefeed
  • $$ - $ (dollar sign)

    Variables

  • %USERNAME% - Current Username
  • %COMPUTERNAME% - Local computer name
  • %USERDOMAIN% - Local domain name

    The default prompt is "G" (e.g. "C:\>"), some alternatives include:

  • [%computername%]P$G to show the computer, drive and path
  • [%username%]P$G to show the current user, drive and path 
  • Settings:
    System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
    Name: PROMPT
    Type: REG_EXPAND_SZ (Expanded String Value)
    Value: Prompt Text (e.g. G)

    4. Allow UNC Paths at the Command Prompt (Windows NT/2000/XP)

    The Command Processor normally checks and disallows UNC names from being used for the current directory in the Command Prompt as they may cause problems with launched child processes. This tweak can be used to allow UNC paths and remove the warning message.

    Create a new DWORD value, or modify the existing value called 'DisableUNCCheck' using the settings below.

    Exit your registry, you may need to restart or log out of Windows for the change to take effect.

    Note: If you enable this feature and start a Console that has a current directory of an UNC name, start applications from that Console, and then close the Console, it could cause problems in the applications started from that Console.


    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    Name: DisableUNCCheck
    Type: REG_DWORD (DWORD Value)
    Value: (0 = default, 1 = allow UNC)

    5. Add Command Prompt Option to Every Folder (All Windows)

    If you still use the DOS prompt regularly then this setting creates a new right-click menu option to open a command prompt at the selected directory.

    Create a new sub key called 'Command' under the main key (i.e. [HKEY_CLASSES_ROOT\Directory\shell\Command]). Change the value of '(Default)' within the key to equal the text you would like on the right-click menu, for example 'Command Prompt'.

    Create another new sub-key under the key created above, named 'command' (i.e. [HKEY_CLASSES_ROOT\...\Command\command]). Change the value of '(Default)' within this key depending on your operating system to equal either:

    Windows 95, 98 or Me
    command.com /k cd "%1"

    or

    Windows NT, 2000 or XP
    cmd.exe /k cd %1

    Now right-click on a folder and the new option of 'Command Prompt' should be available.

    Settings:
    System Key: [HKEY_CLASSES_ROOT\Directory\shell]
    Name: (Default)
    Type: REG_SZ (String Value)

    6. Change the Command Prompt Colors (Windows NT/2000/XP)

    The value DefaultColor controls the foreground and background colors used in command prompt windows. It has a default value of 0, for standard white text on a black background.

    You can replace this value with a two-digit hexadecimal number, in which the first digit selects a background color and the second a foreground color. The hexadecimal codes are:

    Hexadecimal value Color
    0 Black
    1 Blue
    2 Green
    3 Aqua
    4 Red
    5 Purple
    6 Yellow
    7 White
    8 Gray
    9 Light Blue
    A Light Green
    B Light Aqua
    C Light Red
    D Light Purple
    E Light Yellow
    F Bright White

    A value of F0, for example, would give black text on a white background, and 1E would yield yellow text on a blue background.

    The change should take effect the next time you open a console window.


    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    Name: DefaultColor
    Type: REG_DWORD (DWORD Value)
    Value: (0 = default)

    7. Enable Directory Completion (Windows 2000/XP)

    Directory completion allows you to specify a key, that when pressed, completes the remainder of a directory name, you can press the key multiple times to scroll through the choices.

    Create a new DWORD value, or modify the existing value, called 'PathCompletionChar' and set it to equal the hex value of the required control character. For example to use the TAB key set the value to '9', to use Ctrl-D set the value to '4' and for Ctrl-F set the value to '6'.

    Now when you are using a command prompt and type the first part of a directory name then press the specified key, Windows will complete the remainder of the path for you.

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor]
    Name: PathCompletionChar
    Type: REG_DWORD (DWORD Value)
    Value: Hex Control Character

    8. Quick Edit the Command Prompt (Windows NT/2000/XP)

    Quick Edit allows you to easily cut and paste text in the command prompt window using the mouse. The ability to use the Edit menu options is still possible.

    Create a new DWORD value, or modify the existing value called 'QuickEdit' using the settings below.

    Settings:
    User Key: [HKEY_CURRENT_USER\Console]
    System Key: [HKEY_USERS\.DEFAULT\Console]
    Name: QuickEdit
    Type: REG_DWORD (DWORD Value)
    Value: (0 = disabled, 1 = enabled)

    9. Disable Command Prompt and Batch Files (Windows 2000/XP)

    This restriction allows you to selectively disable the Command Prompt (CMD) and the ability to execute DOS batch files.

    Create or modify the DWORD value "DisableCMD" and set it to a number from the list below.

    • 0 - (default) enable command prompt and batch files
    • 1 - disable command prompt and batch files
    • 2 - disable command prompt but allow batch files
    The change should take effect immediately.

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System]
    Name: DisableCMD
    Type: REG_DWORD (DWORD Value)
    Value: (0 = default, 1 = disabled, 2 = disabled but allow batch)

    10. Disable Single Mode MS-DOS Applications (Windows 95/98/Me)

    This setting allows you to disable the use of real mode DOS applications from within the Windows shell.

    Create a new DWORD value, called 'NoRealMode' and set it to "1" to disable real mode DOS, to re-enable it again later change the value to "0".

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp]
    System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\WinOldApp]
    Name: NoRealMode
    Type: REG_DWORD (DWORD Value)
    Value: (0 = disable, 1 = enable)

    11. Run Startup Programs in a Command Prompt (Windows 2000/XP)

    This setting allows you to specify commands or programs to be automatically executed whenever a command processor is launched. For example, to set environment variables or parameters using a batch file.

    Create a new string value called "AutoRun" and set the value to equal the commands to be automatically executed. Multiple commands should be seperated by double ampersands e.g. "command1 && command2".

    The changes will take effect the next time the command processor is used.

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    Name: AutoRun
    Type: REG_SZ (String Value)
    Value: Command to Execute

    12. Modify the Number of File Handles for DOS Programs (Windows Me)

    This setting controls the number of file handles available to MS-DOS programs run in each virtual machine. In Windows Me, each MS-DOS VM is given the default value of 30 file handles.

    Using notepad open the SYSTEM.INI file in your Windows directory.

    Add the following line to the [386Enh] section:

    PerVMFiles= number
    Restart Windows for the change to take effect.

    Settings:
    Value: Set "PerVMFiles" to the Number of Files

    13. Use High Memory for DOS Drivers (Windows 95/98/Me)

    This setting causes Windows to load the local DOS devices into high memory and freeing up more low memory for DOS applications.

    Open your SYSTEM.INI and add the line:

    LocalLoadHigh=1
    
    Under the [386Enh] section.


    Settings:
    Name: LocalLoadHigh

    Value: 1

    14. Disable Command Processor Extensions (Windows 2000/XP)

    This setting controls whether command extensions are enabled or disabled. When command extensions are used they change the behaviour of various standard command processor functions such as CD, MD, DEL, PROMPT and SET.

    Create a new DWORD value called "EnableExtensions" and set it "1" to enable extensions or "0" to disable them (default is enabled).

    The command extensions involve changes and/or additions to the following commands:

    DEL or ERASE
    COLOR
    CD or CHDIR
    MD or MKDIR
    PROMPT
    PUSHD
    POPD
    SET
    SETLOCAL
    ENDLOCAL
    IF
    FOR
    CALL
    SHIFT
    GOTO
    START
    ASSOC
    FTYPE

    To get specific details, type commandname /? to view the help.

    Note: This setting can also be used as a system wide policy under the HKEY_LOCAL_MACHINE hive.

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    Name: EnableExtensions
    Type: REG_DWORD (DWORD Value)
    Value: (0 = disabled, 1 = enabled)

    15. Enable Delayed Environment Variable Expansion (Windows 2000/XP)

    This setting allows you to enable or disable delayed environment variable expansion in the command processor. If this feature is enabled then exclaimation characters can be used to substitute the value of an environment variable at execution time.

    Create a new DWORD value called "DelayedExpansion" and set it to equal "1" to enabled variable expansion or "0" to disable it.

    Delayed expansion will be available the next time the command processor is used. To access variables surround the variable name with exclaimation characters i.e. "!varname!". For example to echo the PATH variable you could use the following command:

    echo !path!

    Settings:
    User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    Name: DelayedExpansion
    Type: REG_DWORD (DWORD Value)
    Value: (0 = disabled, 1 = enabled)

    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024