Command Prompt - Enable or Disable

How to Enable or Disable the Command Prompt in Vista and Windows 7

information   Information
This will show you how to enable or disable the command prompt with the option to also disable command scripts (.cmd and .bat files) from running for all users in Windows 7 and Vista.

The command prompt is enabled by default.
Note   Note
If you disable the command prompt and a user tries to open a command prompt window, the system displays a message explaining that a setting prevents the action. See the disabled example below.

EXAMPLE: Command Prompt Enabled
NOTE:
The top screenshot is the normal command prompt, and the bottom screenshot is an elevated command prompt.

CMD_Prompt_Enabled.jpg
RunAs_CMD_Prompt_Enabled.jpg
EXAMPLE: Command Prompt Disabled
NOTE:
You will see this message from both command prompts above when set as disabled.

Command_Prompt_Disabled.jpg





OPTION ONE
Using a REG File Download

1. To Enable Command Prompt and Scripts
NOTE: This is the default setting.​
A) Click on the download button below to download the file below.​
Enable_Command_Prompt_and_Scripts.reg
download

B) Go to step 4.​

2. To Disable Command Prompt Only and Allow Scripts
A) Click on the download button below to download the file below.​
Disable_Command_Prompt.reg
download

B) Go to step 4.​

3. To Disable Command Prompt and Scripts
WARNING: Do not prevent (disable) the computer from running batch files (Command Scripts) if the computer uses logon, logoff, startup, or shutdown batch file scripts, or for users that use Terminal Services. They will not work afterwards if you do.​
A) Click on the download button below to download the file below.​
Disable_Command_Prompt_and_Scripts.reg
download

4. Click on Save, and save the .reg file to the Desktop.​
5. Right click on the downloaded .reg file and click on Merge.​
6. Click on Run, Continue (UAC-Vista) or Yes (UAC-Windows7), Yes, and then OK when prompted.​
7. When done, you can delete the downloaded .reg file if you like.​




OPTION TWO
Through the Local Group Policy Editor

1. Open the all users, specific users or groups, or all users except administrators Local Group Policy Editor for how you want this policy applied.​
2. In the left pane, click on User Configuration, Administrative Templates, and System. (See screenshot below)​
Group_Policy.jpg

3. In the right pane, right click on Prevent access to the command prompt and click on Properties. (See screenshot above)​
4. To Enable the Command Prompt and Scripts
A) Select (dot) Disabled or Not Configured and click on OK. (See screenshot below 5C)​
NOTE: Not Configured is the default setting.​
B) Go to step 6.​

5. To Disable the Command Prompt
A) Select (dot) Enabled.​
B) Select Yes or No from the drop down menu to Disable or Allow Command Scripts (.cmd and .bat files) to still run.​
WARNING: Do not prevent (disable) the computer from running batch files (Command Scripts) if the computer uses logon, logoff, startup, or shutdown batch file scripts, or for users that use Terminal Services. They will not work afterwards if you do.​
C) Click on OK.​
Properties.jpg

6. Close the Local Group Policy Editor window. Your done.​





OPTION THREE
Manually in Registry Editor

1. Open the Start Menu, then type regedit in the search box and press Enter.​
2. If prompted by UAC, then click on the Continue (Vista) or Yes (Windows 7).​
3. In regedit, navigate to the location below. (See screenshot below)​
NOTE: If you do not have System in the left pane, then right click on Windows and click on New and Key. Type System and press Enter.​
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System
Reg1.jpg

4. To Disable the Command Prompt
A) In the right pane, right click on a empty area and click on New and DWORD (32-bit) Value. (See screenshot above)​
B) Type DisableCMD and press Enter.​
C) Right click on DisableCMD and click on Modify. (See screenshot below)​
Reg2.jpg
D) To Disable Command Prompt Only and Allow Scripts
  • Type 2 and click on OK. (See screenshots below)
Modify2.jpg
Reg4.jpg

E) To Disable Command Prompt and Scripts
WARNING: Do not prevent (disable) the computer from running batch files (Command Scripts) if the computer uses logon, logoff, startup, or shutdown batch file scripts, or for users that use Terminal Services. They will not work afterwards if you do.​
  • Type 1 and click on OK. (See screenshots below)
Modify1.jpg
Reg3.jpg

F) Go to step 7.​

6. To Enable Command Prompt and Scripts
NOTE: This is the default setting.​
A) In the right pane, right click on DisableCMD and click on Delete. (See screenshot above)​
B) Click on Yes to confirm deletion.​

7. Close regedit.​
That's it,
Shawn


 

Attachments

Last edited:

My Computers

System One System Two

  • Operating System
    Windows 10 Pro 64-bit
    Manufacturer/Model
    Custom
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2, 4TB Samsung 990 PRO PRO M.2, 8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Mouse
    Logitech MX Master 3
    Keyboard
    Logitech wireless K800
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Other Info
    Logitech Z625 speaker system, Logitech BRIO 4K Pro webcam, HP Color LaserJet Pro MFP M477fdn, APC SMART-UPS RT 1000 XL - SURT1000XLI, Galaxy S23 Plus phone
  • Operating System
    Windows 10 Pro
    Manufacturer/Model
    HP Envy Y0F94AV
    CPU
    i7-7500U @ 2.70 GHz
    Memory
    16 GB DDR4-2133
    Sound Card
    Conexant ISST Audio
    Monitor(s) Displays
    17.3" UHD IPS touch
    Screen Resolution
    3480 x 2160
    Hard Drives
    512 GB M.2 SSD
You're welcome Kevin. :)
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro 64-bit
    Manufacturer/Model
    Custom
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2, 4TB Samsung 990 PRO PRO M.2, 8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Mouse
    Logitech MX Master 3
    Keyboard
    Logitech wireless K800
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Other Info
    Logitech Z625 speaker system, Logitech BRIO 4K Pro webcam, HP Color LaserJet Pro MFP M477fdn, APC SMART-UPS RT 1000 XL - SURT1000XLI, Galaxy S23 Plus phone
  • Operating System
    Windows 10 Pro
    Manufacturer/Model
    HP Envy Y0F94AV
    CPU
    i7-7500U @ 2.70 GHz
    Memory
    16 GB DDR4-2133
    Sound Card
    Conexant ISST Audio
    Monitor(s) Displays
    17.3" UHD IPS touch
    Screen Resolution
    3480 x 2160
    Hard Drives
    512 GB M.2 SSD
You're welcome i7pro, and welcome to Vista Forums.

It really depends on the antivirus program and it's definition updates, but it's not uncommon for a keylogger to cause a antivirus program to throw up a red flag on it.
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro 64-bit
    Manufacturer/Model
    Custom
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2, 4TB Samsung 990 PRO PRO M.2, 8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Mouse
    Logitech MX Master 3
    Keyboard
    Logitech wireless K800
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Other Info
    Logitech Z625 speaker system, Logitech BRIO 4K Pro webcam, HP Color LaserJet Pro MFP M477fdn, APC SMART-UPS RT 1000 XL - SURT1000XLI, Galaxy S23 Plus phone
  • Operating System
    Windows 10 Pro
    Manufacturer/Model
    HP Envy Y0F94AV
    CPU
    i7-7500U @ 2.70 GHz
    Memory
    16 GB DDR4-2133
    Sound Card
    Conexant ISST Audio
    Monitor(s) Displays
    17.3" UHD IPS touch
    Screen Resolution
    3480 x 2160
    Hard Drives
    512 GB M.2 SSD
You're most welcome i7pro. :)
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro 64-bit
    Manufacturer/Model
    Custom
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2, 4TB Samsung 990 PRO PRO M.2, 8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Mouse
    Logitech MX Master 3
    Keyboard
    Logitech wireless K800
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Other Info
    Logitech Z625 speaker system, Logitech BRIO 4K Pro webcam, HP Color LaserJet Pro MFP M477fdn, APC SMART-UPS RT 1000 XL - SURT1000XLI, Galaxy S23 Plus phone
  • Operating System
    Windows 10 Pro
    Manufacturer/Model
    HP Envy Y0F94AV
    CPU
    i7-7500U @ 2.70 GHz
    Memory
    16 GB DDR4-2133
    Sound Card
    Conexant ISST Audio
    Monitor(s) Displays
    17.3" UHD IPS touch
    Screen Resolution
    3480 x 2160
    Hard Drives
    512 GB M.2 SSD
Since both REG and CMD are disabled, it will need to be done from outside of Vista instead. :(
Hello brink,
I am afraid that in this case I am in this situation. I still have access to the original Administrator account but I can only figure the best way to solve this is to create a completely new account on the computer. It started out when my little brother had decided it would be cool to download some team fortress 2 hacks and did not know what was what. SOMEHOW Task Manager, Registry Editor, and Command prompt were all disabled to this account, all showing the the same disabled by administrator message. Please help me I do not have the kind of time to create a new account and re-install all the programs I have on this account.
thanks,
xJester
P.S i am running windows vista home premium 32bit
 

My Computer

Hello Jester, and welcome to Vista Forums.

If you have a retail Vista, then you can do a repair install to fix this without losing anything.

Hope this helps,
Shawn
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro 64-bit
    Manufacturer/Model
    Custom
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2, 4TB Samsung 990 PRO PRO M.2, 8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Mouse
    Logitech MX Master 3
    Keyboard
    Logitech wireless K800
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Other Info
    Logitech Z625 speaker system, Logitech BRIO 4K Pro webcam, HP Color LaserJet Pro MFP M477fdn, APC SMART-UPS RT 1000 XL - SURT1000XLI, Galaxy S23 Plus phone
  • Operating System
    Windows 10 Pro
    Manufacturer/Model
    HP Envy Y0F94AV
    CPU
    i7-7500U @ 2.70 GHz
    Memory
    16 GB DDR4-2133
    Sound Card
    Conexant ISST Audio
    Monitor(s) Displays
    17.3" UHD IPS touch
    Screen Resolution
    3480 x 2160
    Hard Drives
    512 GB M.2 SSD
Thanks brink for the reply,
Unfortunately (again) Vista Home Premium came installed on the computer, So is there any other way that I might Possibly access and edit permissions of this account from another administrator account?? If this is possible or there is a better way that would be great.

Thanks,
xJester
 

My Computer

Jester,

Your computer has been infected with a virus or some form of malware. Before trying to create a new account, you should make sure that your computer is clean first by thoroughly scanning it with a good antivirus program and a antimalware program like the free Malwarebytes.

If you still cannot get things back in order afterwards, then you can try doing a system restore at boot using a restore point dated before you had this issue to hopefully fix it for you. If not, then you may need to do a factory restore instead since you do not have any other administrator account that you can access.
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro 64-bit
    Manufacturer/Model
    Custom
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2, 4TB Samsung 990 PRO PRO M.2, 8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Mouse
    Logitech MX Master 3
    Keyboard
    Logitech wireless K800
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Other Info
    Logitech Z625 speaker system, Logitech BRIO 4K Pro webcam, HP Color LaserJet Pro MFP M477fdn, APC SMART-UPS RT 1000 XL - SURT1000XLI, Galaxy S23 Plus phone
  • Operating System
    Windows 10 Pro
    Manufacturer/Model
    HP Envy Y0F94AV
    CPU
    i7-7500U @ 2.70 GHz
    Memory
    16 GB DDR4-2133
    Sound Card
    Conexant ISST Audio
    Monitor(s) Displays
    17.3" UHD IPS touch
    Screen Resolution
    3480 x 2160
    Hard Drives
    512 GB M.2 SSD
Jester,

Your computer has been infected with a virus or some form of malware. Before trying to create a new account, you should make sure that your computer is clean first by thoroughly scanning it with a good antivirus program and a antimalware program like the free Malwarebytes.

If you still cannot get things back in order afterwards, then you can try doing a system restore at boot using a restore point dated before you had this issue to hopefully fix it for you. If not, then you may need to do a factory restore instead since you do not have any other administrator account that you can access.



Thanks for all you help Brink My virus scanner found the Malware and has removed it and everything is back to normal
 

My Computer

You're most welcome Jester. I'm happy to hear that you got it sorted. :)
 

My Computers

System One System Two

  • Operating System
    Windows 10 Pro 64-bit
    Manufacturer/Model
    Custom
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2, 4TB Samsung 990 PRO PRO M.2, 8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Mouse
    Logitech MX Master 3
    Keyboard
    Logitech wireless K800
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Other Info
    Logitech Z625 speaker system, Logitech BRIO 4K Pro webcam, HP Color LaserJet Pro MFP M477fdn, APC SMART-UPS RT 1000 XL - SURT1000XLI, Galaxy S23 Plus phone
  • Operating System
    Windows 10 Pro
    Manufacturer/Model
    HP Envy Y0F94AV
    CPU
    i7-7500U @ 2.70 GHz
    Memory
    16 GB DDR4-2133
    Sound Card
    Conexant ISST Audio
    Monitor(s) Displays
    17.3" UHD IPS touch
    Screen Resolution
    3480 x 2160
    Hard Drives
    512 GB M.2 SSD
Back
Top