RackNerd Billboard Banner

How to Run Command Prompt Commands With a Desktop Shortcut

Need to run a Command Prompt command fast—without typing it out each time? You can turn that command into a desktop shortcut. This is a quick and easy way to automate tasks, launch diagnostics, or streamline your workflow with a double-click.

Here’s how to create a desktop shortcut that runs any Command Prompt (CMD) command in Windows.


Step 1: Right-Click on Your Desktop

Start by creating a new shortcut:

  1. Right-click on your desktop.
  2. Select New > Shortcut.

Step 2: Enter the Command

When prompted to enter the location of the item, use this format:

cmd /c your-command-here

Example 1: Open Notepad

cmd /c notepad

Example 2: Ping Google

cmd /c ping google.com

Example 3: Run a batch file

cmd /c "C:\Path\To\Your\File.bat"

cmd /c tells Windows to open Command Prompt, run the command, then close it.

Click Next after entering your command.


Step 3: Name Your Shortcut

Give your shortcut a name that makes sense, like:

  • “Open Notepad”
  • “Ping Google”
  • “Run Cleanup Script”

Then click Finish.


Step 4: Customize the Shortcut (Optional)

You can change the icon or run the command as administrator:

To Change the Icon:

  1. Right-click the shortcut > Properties.
  2. Click Change Icon.
  3. Pick from the list or browse to a custom icon.

To Run as Administrator:

  1. Right-click the shortcut > Properties.
  2. Under the Shortcut tab, click Advanced.
  3. Check Run as administrator, then click OK.

This is helpful for commands that require elevated privileges, like sfc /scannow or disk cleanup scripts.


Bonus: Use Command Line Parameters

You can chain commands or add switches directly in the shortcut:

cmd /c "ipconfig && pause"

This runs ipconfig and keeps the window open so you can read the output.


Wrap-Up

Using desktop shortcuts to run CMD commands saves time and keeps things efficient—especially for repetitive tasks. Whether you’re automating system checks, launching programs, or debugging network issues, a simple shortcut can do the job in one click.

Give it a try and build a custom toolkit right on your desktop.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
RackNerd Billboard Banner
© 2025 Computer Everywhere
Your Everyday Guide to the Digital World.
Terms of Service | Privacy Policy
Copy link