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:
- File Explorer address bar
- Task Manager (Click File > Run new task to use the command)
You can also use 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 name of the shortcut if you don’t like the suggestion? Click “Finish.”
How to Open Elevated Command Prompt in Windows 11
“Elevated Command Prompt” refers to Command Prompt with administrator privileges.
Remember that you can run some commands (such as sfc) only from the elevated Command Prompt. Let’s look at the different ways to open it.
Open the Start menu and type cmd. The Command Prompt appears in the search results. Right-click on it and select “Run as administrator.” You’ll see the elevated Command Prompt when you click Yes in the UAC popup.
Administrator: Command Prompt appears in the title at the top. The “Administrator” indicates that the Command Prompt is opened as an administrator.
Launch Task Manager and click File > Run new task.
Type cmd in the “Create new task” box. Select “Create this task with administrative privileges.” Press the “Enter” key.
Open the Start menu and click the All apps button. Click on Windows Tools, and you’ll see “Command Prompt.”
Right-click on it, select “Run as administrator,” and click Yes.
Go to C: > Windows > System32 folder. Locate the “cmd” file. Right-click it and choose “Run as administrator.” In the UAC popup, click Yes.
Open Run Command. Type cmd, then press Ctrl + Shift + Enter. In the UAC popup, click “Yes.”
Launch PowerShell as administrator. Type start cmd and then press the “Enter” key.
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 then 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 change 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. In the Shortcut tab, you’ll find the “Start in” field.
Enter the directory path you want in that field. Hit the OK button.
That’s it. Whenever you use the shortcut, the Command Prompt will open in the directory you set. 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 and 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 above steps, 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 key.
Now right-click on the blank space in the right pane. Select New > DWORD (32-bit) Value. Enter DisableCMD and press 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.