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

Published by Nyau Wai Hoe - Updated on

Windows’ taskbar has long been a hub for instant access to your most-used applications. Pinning applications, folders, and even specific files to the taskbar can greatly enhance productivity by reducing the number of clicks required to access these items. However, you might have noticed that Windows 11 doesn’t directly allow pinning certain items like batch files or Command Prompt with administrative privileges to the taskbar. This is where we need to employ a simple workaround – creating shortcuts for these items and pinning those instead. In this article, we’ll guide you through this process in detail.

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

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

Understanding batch files and Command Prompt (Admin)

Batch Files: A batch file is a script file in DOS, OS/2, and Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. Batch files can be used to automate tasks, execute multiple commands in a specific order, and simplify complex workflows.

Command Prompt (Admin): This is an elevated instance of the command prompt, which allows users to execute commands with administrative privileges. This can be necessary for tasks that require changes to system files or settings, such as installing certain software or modifying system configurations.

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 allow you to directly pin batch files or Command Prompt with administrative privileges to the taskbar.

Why can't I pin batch file to taskbar

The taskbar in Windows is designed to host shortcuts to applications. When you pin an application to the taskbar, you’re essentially creating a shortcut to that application. Batch files, while executable, are not applications in the traditional sense. Similarly, the Command Prompt (Admin) is not a separate application, but rather a different mode of running the Command Prompt. As a result, these cannot be pinned directly 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. Here’s how:

  1. Locate the batch file in your system that you want to pin to the taskbar. Right-click on the file, select “Show more options”, then select “Send to” > “Desktop (create shortcut)”.Create a desktop shortcut for Batch file
  2. Go to your desktop and locate the newly created shortcut. Right-click on the shortcut and select “Properties”.Bat file Properties Windows 11
  3. In the Properties window, navigate to the “Shortcut” tab. In the “Target” field, prefix the existing path with cmd.exe /c . This tells the system to open the batch file with Command Prompt. 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
  4. Click “Apply” then “OK” to save changes.
  5. Now, right-click the shortcut on your desktop, select “Show more options”, then select “Pin to taskbar”.How to pin a batch file to taskbar in Windows 11

The batch file will now be pinned to your taskbar and can be accessed with a single click.

Bat file pin to taskbar

Linked issue: Batch (.BAT) Files Not Running in Windows 11/10

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

Pinning the Command Prompt with administrative privileges requires a similar workaround. Here’s how it’s done:

  1. Press the Windows key to open the search bar. Type “CMD” into the search bar, and the Command Prompt application should appear.
  2. Right-click on the “Command Prompt” and select “Open file location”. This will open the System Tools folder, where the Command Prompt shortcut is located.Command Prompt Open File Location
  3. In the System Tools folder, right-click on the “Command Prompt” shortcut and select “Copy”.
  4. Go to your desktop, right-click on an empty space, and select “Paste” to place the copied shortcut.Copy Command Prompt shortcut to the desktop
  5. Now, right-click on the newly created Command Prompt shortcut on your desktop, and choose “Properties”.Command Prompt Properties Windows 11
  6. (Optional) In the Properties window, navigate to the “Shortcut” tab and locate the “Shortcut key” field. Here you can assign a shortcut key for launching Command Prompt as admin, for example, 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. Lastly, right-click on the Command Prompt shortcut on your desktop, select “Show more options”, then select “Pin to taskbar”.How to pin CMD with Administrator to taskbar in Windows 11

Your Command Prompt (Admin) is now pinned to the taskbar. You can launch it with administrative privileges directly from your taskbar, or by using the shortcut key you assigned.

Command Prompt administrator Pin to taskbar


The taskbar is a powerful tool for improving productivity and convenience on your Windows 11 system. Although some items cannot be directly pinned, the workaround of creating shortcuts and pinning them to the taskbar is a simple solution. Whether you’re a developer, a power user, or simply someone who likes to keep things organized and handy, these steps should help save time and perform tasks more efficiently in Windows 11.

Categories: ComputingWindows 11

Nyau Wai Hoe
Nyau Wai Hoe is the Founder and Chief Editor of 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