Home » How To » How to Run Command Prompt Commands with Desktop Shortcut

How To Run Commands With a Desktop Shortcut on Windows 10/11

Running a command on Windows is easy. Simply open the Command Prompt or PowerShell window, type the command of your choice, and press Enter. This process is good enough for those commands you only run every once in a while. However, if you run a specific command frequently, creating a desktop shortcut to run that command makes things easier.

For example, if you are a network administrator or gamer, you might want to check the ping of your network to ensure its stability. In that case, you can create a desktop to execute that command. Once you do that, double-clicking on the desktop runs the command.

Let’s get started and learn how to run commands with a desktop shortcut.

Create a Desktop Shortcut To Run a Command

To create a desktop shortcut that can run your chosen command, follow along with the below steps.

First, right-click on the desktop and select the New > Shortcut option. This will open the shortcut wizard.

Command-prompt-command-desktop-shortcut-new-shortcut

In the blank field, enter the following command while replacing YOUR_COMMAND_HERE with the command you want to run. Click the Next button.

C:\Windows\System32\cmd.exe /k YOUR_COMMAND_HERE

For example, if you want to run the Ping command, this is how the command looks like.

C:\Windows\System32\cmd.exe /k ping google.com

If you want to, you can also run multiple commands using the same desktop shortcut. For that, you have to modify the command like so:

C:\Windows\System32\cmd.exe /k FIRST_COMMAND & SECOND_COMMAND
Command-prompt-command-desktop-shortcut-add-command

Enter a name for the shortcut and click Finish. The name can be anything you want, just make sure it is descriptive for you.

Command-prompt-command-desktop-shortcut-name

That is it. The desktop shortcut that can run your chosen command has been created.

Command-prompt-command-desktop-shortcut-created

From now on, simply double-click on the shortcut and the command will be executed in the Command Prompt window.

Command-prompt-command-desktop-shortcut-execute

Keep in mind that when you execute multiple commands with the same desktop shortcut, the Command Prompt will execute the commands one after another, not simultaneously.

Note: The above method cannot execute commands that require admin rights. For that, create a shortcut with admin rights to run programs as an administrator.

(Optional) Change the Desktop Shortcut Icon

If you are not a fan of the default Command Prompt icon, you can change its icon. To do that, right-click on the shortcut and select Properties. Now, click the Change Icon button, select an icon of your choice, and then click OK.

That is all. It is that simple to run Command Prompt commands with a desktop shortcut.

If you have any questions, comment below and we’ll answer.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top