In this post, you’ll see:
Here, I’m using Windows 11. Let’s start.
How to Open Command Prompt and Create a Shortcut for it
You can launch Command Prompt in Windows 11 using the command cmd. You can use this command in the following programs:
- Run Command
- File Explorer address bar
- Task Manager (Click File > Run new task to use the command)
You can also use the start cmd in “Windows PowerShell” to open the Command Prompt.
Open the Start menu and type cmd. The Command Prompt app will appear in the search results. Click on it to open it.
Open the Start menu and click the All apps button. Select Windows Tools. Double-click Command Prompt.
Go to C: > Windows > System32 folder. Find and double-click the “cmd” file.
How to Create Command Prompt Shortcut
Here you’ll find instructions on creating a shortcut to the Command Prompt on your Windows 11 desktop or File Explorer.
Right-click on your desktop or File Explorer blank area. Hover the mouse over “New” and click “Shortcut.”
On the “Create Shortcut” popup, type cmd. Click “Next.” Would you please provide the shortcut’s name if you don’t like the suggestion? Click “Finish.”
How to Change Command Prompt Default Directory
If you want to change the default directory in the Windows 11 Command Prompt, then follow these steps:
Open Registry Editor. I suggest you take a Registry backup before proceeding.
Go to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Command Processor.
Right-click on the blank space in the right pane. Select New > String Value. Provide the name as Autorun and then hit the Enter key.
Double-click it. Provide the cd /d and the directory path you want in the Value data field. I want to set up the Windows directory, and this is what I should enter: cd /d c:\windows
Hit the OK button.
That’s all. Check the changes by launching Command Prompt. To revert, delete the String Value you’ve created above.
If you have a Command Prompt shortcut on your desktop and you want the Command Prompt to open in a specific directory while using the shortcut, you can follow these steps:
Right-click on the shortcut and hit Properties. You’ll find the “Start in” field in the Shortcut tab.
Enter the directory path you want in that field. Hit the OK button.
That’s it. The Command Prompt will open in the directory you set whenever you use the shortcut. Other methods to launch Command Prompt will open in the default directory.
Remember that when you use this shortcut to open Command Prompt as an administrator, it’ll open in the “Target” directory, not the directory you set. You can see the “Target” directory above “Start in” in the shortcut’s Properties window.
How to Disable Command Prompt in Windows 11
Here are two ways to disable the Command Prompt in Windows 11. Use the one you prefer.
Open local group policy editor. Navigate to the User Configuration > Administrative Templates > System.
Double-click “Prevent access to the command prompt” in the right pane and select Enabled.
Select Yes from the drop-down list if you don’t wish to run batch files (.cmd and .bat). Click the OK button.
Note: To enable Command Prompt, follow the steps above, but select Not Configured or Disabled.
Launch Registry Editor. I suggest a Registry backup before proceeding. Go to HKEY_CURRENT_USER > Software > Policies > Microsoft > Windows.
Hit System. If it isn’t there, create it. You can do this by right-clicking on Windows, selecting New > Key, typing System, and hitting Enter.
Now right-click on the blank space in the right pane. Select New > DWORD (32-bit) Value. Enter DisableCMD and press the Enter key.
Double-click it and enter 2 (to disable Command Prompt) or 1 (to disable Command Prompt and running batch files) in the Value field. Hit the OK button.
From now on, you’ll see this message every time you access the Command Prompt:
The command prompt has been disabled by your administrator.
Press any key to continue.
Note: To enable Command Prompt, remove the DWORD you’ve created above or replace 2 or 1 with 0 in the Value data field.