Creating a Taskbar Button for Special Purposes (e.g., Run a Batch File; Open a Folder)

As described in another post, I wanted to create a button, on my Windows 7 taskbar, to run a batch file that would kill all Google Chrome processes, as a workaround solution to a virus I could not get rid of.

For most programs other than batch files, I could create such a button just by running the program in question (e.g., Firefox); and when the program was running, I could right-click on its taskbar icon and choose the “Pin this program to taskbar” option. But there was no such option for some situations. This batch file was one example; a taskbar icon to open a specific folder was another.

This post describes the steps I took to create a persistent taskbar icon that would run a batch file to kill all Chrome processes. This post summarizes a more detailed presentation by 7Tutorials. The steps I took were as follows:

  • I needed to start with a shortcut to an .exe file. For this, I could just find an .exe file, right-click on it, and create a shortcut; or I could copy an existing shortcut (e.g., my shortcut to Winamp.exe or Notepad.exe). There were some programs whose shortcuts would not work: I had to be able to right-click on the shortcut and edit its Properties > Target.
  • I right-clicked on the chosen .exe shortcut and went into its Properties. In the General tab, I changed the shortcut’s name as desired. In the Shortcut tab, I clicked on Change Icon and chose something nice.
  • While I was in the Shortcut tab, I changed the Target to point to the desired folder or other item. Then I changed the Target to invoke explorer.exe. Here’s how my Target looked:
C:\Windows\explorer.exe "X:\Start Menu\Programs\KillChrome.bat"
  • Also, in the Shortcut tab, I changed Start In to C:\Windows.
  • I exited the shortcut’s Properties and stored the shortcut in a folder where I would want to keep it. I chose a folder in my customized, shareable Start Menu, but other locations would be fine too. The Start Menu folder I chose was the one that held other shortcuts related to Chrome.
  • I dragged the shortcut to the taskbar.

That last step gave me a new shortcut in the folder containing my taskbar’s shortcuts. That folder was at C:\Users\Ray\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar. (Of course, other users would replace the “Ray” in that path with their own username.)

The procedure would be the same if I wanted the taskbar shortcut to open a folder instead of running a batch file. For example, I could open the folder instead of the batch file by just removing the “KillChrome.bat” part from the end of the Target line shown above.

A similar procedure would work to pin Control Panel items to the taskbar. In that case, I would start by dragging the Control Panel item to the desktop. That would create the shortcut that I would then adjust as described above. Or I could use a batch file to run a command opening the desired Control Panel item.

A Lifehacker post noted that jump lists could be used to organize and expand the functionality of taskbar icons. It appeared there were also ways to bring back some of the Windows XP option of putting various icons into dockable auto-hiding toolbars on the left, right, and top sides of the screen.

This entry was posted in Uncategorized and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

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