Search code examples
javawindows-7taskbarstartmenu

Creating a Windows 7 Taskbar Icon


My Goal


I want to make it so that, on first run, my program will make its icon appear in the Windows 7 Taskbar. I know that the icon files are shortcuts in C:\Users\USERNAME\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar and mostly want to know this:

My Questions


  1. How, in Java, can I create a shortcut file (.lnk)
  2. Is it possible to even access that without admin privileges?

Solution

  • You should not need admin privileges but you do need to do this in context of the user whose taskbar is being changed.

    Here's a library which does what you want: http://alumnus.caltech.edu/~jimmc/jshortcut/