RUN CMD Commands With a Desktop Shortcut on Windows 10

Posted by

keyboard-feature-1000x450

Some users use Command Prompt daily. Some use to flush the DNS every time they get an internet error; and some use it to reset the DNS cache, some use it to find the IP address. Here we have shared an easy method to RUN CMD Commands with a desktop shortcut on Windows 10.

If you have been using Windows operating system for a while, then you might be well aware of CMD or Command Prompt. It’s one of the most powerful tools in Windows, which is used to operate a wide range of tasks. It’s a command-line interpreter that can be used to access some of the core features of Windows.

There were lots of users who use Command Prompt daily. Some use to flush the DNS every time they get an internet error; some use it to reset the DNS cache, and some use it to find the IP address. So, if you are amongst those who use CMD at regular intervals, then this post might be beneficial to you.

How to RUN CMD Commands With a Desktop Shortcut on Windows 10

In this article, we are going to share a method that would let you run CMD commands directly from the desktop. For that, we need to create a command prompt shortcut on the desktop. Once created, you can make the desktop shortcut to execute the CMD command of your wish.

Step 1. First of all, Right-click on the desktop, and select – New > Shortcut.

select - New > Shortcut
select – New > Shortcut

Step 2. Under the Create Shortcut box, you need to enter ‘C:\Windows\System32\cmd.exe‘ on the location field and click on the ‘Next’ button.

enter 'C:\Windows\System32\cmd.exe' on the location field
enter ‘C:\Windows\System32\cmd.exe’ on the location field

Step 3. In the final step, you would be asked to type a name for the new shortcut. Simply name it as per your wish.

type a name for the new shortcut
type a name for the new shortcut

Step 4. Once done, right-click on the Shortcut file and select ‘Properties’

Select 'Properties'
Select ‘Properties’

Step 5. Under the ‘Target’ field, you need to enter ‘/k followed by your CMD command

The target field would look like this after the modification – "C:\Windows\System32\cmd.exe" /k echo hello world

The target field
The target field

Note: The "/k" between the command tells the command prompt to run the command that you will type after it.

Similarly, you can try the automatic ping command – "C:\Windows\System32\cmd.exe" /k ping www.google.com

Another example of target field
Another example of target field

To flush the DNS cache, you need to create a shortcut with – "C:\Windows\System32\cmd.exe" /k ipconfig /flushdns

Important: Make sure to remove the double Apostrophe (“) symbols from the target fields, or else it will not work.

Feel free to leave a comment below or reach me on Instagram @iamshubhamkumar__.

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.