Pin Batch File or CMD (Admin) to Taskbar in Windows 11

Published by Nyau Wai Hoe - Updated on

If you often pin apps, folders and other items on the taskbar on Windows, you might have noticed that Windows 11 doesn’t actually let you directly pin certain items, such as batch files or the Command Prompt with admin privileges, to the taskbar. For this, we can use a simple workaround – create a shortcut for such items, and then pin that shortcut to the taskbar. This guide will show you how to do it.

Also see: How to Pin Folders to Taskbar in Windows 11

Pin Batch File or CMD (Admin) to Taskbar in Windows 11

What are batch files and Command Prompt (Admin)?

Batch Files: These are like to-do lists for your computer, telling it to run a bunch of commands in order. They’re very useful for automating repetitive tasks.

Command Prompt (Admin): This is a version of the Command Prompt with admin rights. It’s needed for tasks that change system files or settings, like installing certain software.

Useful tip: How to Ungroup Taskbar Items in Windows 11

Why pinning batch files and CMD (Admin) directly to the taskbar is not possible

Before we get into the steps, let’s briefly understand why Windows 11 does not let you directly pin batch files or Command Prompt with administrative privileges to the taskbar.

Why can't I pin batch file to taskbarThe taskbar prefers shortcuts to apps. Pinning an app means to create a shortcut of it. But batch files and the admin version of Command Prompt aren’t seen as apps in the usual sense, so you can’t directly pin them to the taskbar.

Recommended resource: How to Run CMD or PowerShell as SYSTEM in Windows 11

How to pin a batch file to the taskbar in Windows 11

Since you can’t directly pin a batch file to the taskbar, you first need to create a shortcut to the batch file, and then pin that shortcut instead. For detailed instructions, follow the steps below:

  1. Find the batch file you want to pin. Right-click it, choose “Show more options”, then “Send to” > “Desktop (create shortcut)”.Create a desktop shortcut for Batch file
  2. Head to your desktop, find the new shortcut, and right-click it for “Properties”.Bat file Properties Windows 11
  3. In the Properties window, hit the “Shortcut” tab. Add cmd.exe /c before the path in the “Target” field. This tells your computer to use Command Prompt to open the batch file.
  4. For example, if the original target was "C:\Users\YourUsername\Documents\yourfile.bat", it should now be cmd.exe /c "C:\Users\YourUsername\Documents\yourfile.bat".
    Run batch file shortcut with CMD
  5. Click “Apply” then “OK” to save the changes.
  6. Finally, right-click the shortcut on your desktop, select “Show more options”, then “Pin to taskbar”.How to pin a batch file to taskbar in Windows 11

And just like that, your batch file is now a single click away on your taskbar.

Bat file pin to taskbarLinked issue: Batch (.BAT) Files Not Running in Windows 11/10

How to pin Command Prompt (Admin) to the taskbar in Windows 11

To pin Command Prompt with admin rights to the taskbar, follow the steps below:

  1. Pres the Windows key, type “CMD” in the search, and you should see Command Prompt pop up.
  2. Right-click on “Command Prompt” and pick “Open file location”. This opens up the folder where the CMD shortcut is located.Command Prompt Open File Location
  3. In that folder, right-click the “Command Prompt” shortcut and select “Copy”.
  4. Go back to your desktop, right-click somewhere empty, and choose “Paste” to drop the shortcut there.Copy Command Prompt shortcut to the desktop
  5. Right-click on the new Command Prompt shortcut on your desktop and go for “Properties”.Command Prompt Properties Windows 11
  6. (Optional) In the Properties window, go to the “Shortcut” tab and find the “Shortcut key” field. Here you can set up a keyboard shortcut to launch Command Prompt as admin, like Ctrl + Alt + C.Set keyboard shortcut to run CMD as admin
  7. Still under the “Shortcut” tab, click the “Advanced” button. In the window that opens, check the box next to “Run as administrator”. Click on “OK” to close the Advanced Properties window, then click on “Apply” and “OK” to close the Command Prompt Properties window.
    Set CMD to always run as administrator
  8. Last step, right-click on the Command Prompt shortcut on your desktop, choose “Show more options”, then “Pin to taskbar”.How to pin CMD with Administrator to taskbar in Windows 11

The Command Prompt’s shortcut is now pinned to the taskbar. You can launch it with admin rights directly from your taskbar, or by using the shortcut key you assigned.

Command Prompt administrator Pin to taskbar

Some final words

The taskbar is your best buddy for making things quick and easy (like launching programs) on Windows 11. Even though some things can’t be pinned right off the bat, this shortcut trick gives you a backdoor. It’s perfect for anyone who wants to keep things swift, from devs and power users to anyone who just likes their Windows interface tidy and, most importantly, efficient.

Categories: ComputingWindows 11

Nyau Wai Hoe
Nyau Wai Hoe is the Founder and Chief Editor of WindowsDigitals.com. With a degree in software engineering and over 12 years of experience in the tech support industry, Nyau has established himself as an expert in the field, with a primary focus on the Microsoft Windows operating system. As a tech enthusiast, he loves exploring new technologies and leveraging them to solve real-life problems.

Share via
Copy link