Opening the Command Prompt and running some commands every time is somewhat a tedious job. Are you also bored of using it constantly? If yes, then why not you use a double-clickable desktop shortcut rather than typing and executing some specific commands. This can be helpful if you run some CMD commands frequently.
By the way, Windows provides you various ways to open the command prompt but typing and executing the same command may become tiresome sometimes. To make it easy, read this post and we will show you an easy tweak to run command prompt commands with a desktop shortcut. So let’s get started
Run Command Prompt commands with a Desktop Shortcut
Running Command Prompt commands with a Desktop shortcut is a quite simple process that doesn’t require much knowledge. All you just need to follow the method mentioned below:
First of all, you have to create a Command Prompt shortcut.
To do this, right-click on the empty space of your Desktop screen and then select New > Shortcut.
Doing this, the Windows will open a pop-up window right away.
Here you need to give the location of the item you want to execute whenever you run the shortcut.
To do so, type the below text line and then click on the Next button:
This will call the cmd executable file to run the command prompt.
On the next page, it will ask you to name the shortcut as you wish. After naming it, click on the Finish button to create the shortcut.
Once it is done, do a right-click on the Shortcut file and select Properties from the context menu.
In the Properties window, make sure you’re on the Shortcut tab.
Now go to the Target field and add /k followed by your CMD command.
It will look something like – C:\Windows\System32\cmd.exe /k followed by the command you want to add.
Here “/k” tells Command Prompt to execute the command that you type after it.
Note: If you need to add more shortcuts, just repeat the above procedure.
In case you want to edit the previously created shortcut command, then simply do a right-click it on it and select the Properties option. After that, add the new command under the Target field.
For instance, you can create the shortcut command for running the System File Checker tool. To create it, type the below command under the target field:
C:\Windows\System32\cmd.exe /k sfc /scannow
This will tell the command prompt to run the System File Checker tool to scan the damaged and corrupted system files.
In the same way, you can check how fast you get a response from Google. Since ping is measured in milliseconds, you will have to use the command:
C:\Windows\System32\cmd.exe" /k ping www.google.com
Once you complete the process, run a command via the shortcut instead of opening the command prompt and typing the same commands each time.
Furthermore, if you want to run multiple commands using the Windows 10 Shortcut, you only need to add an ampersand (&) between the commands.
C:\Windows\System32\cmd.exe /k echo Welcome & echo World
This will print Welcome World.
Here you don’t need to use “/k” for each further command. Assign it with the first command and will do the rest.
I hope you find this article helpful.