KB00074 - Starting Stickies using registry Run key
Acknowledgements
The text of this article was taken from a forum post by Jerome Paries on Jan 23rd 2012.
There are two ways to solve this.
- Method 1: use a shortcut
First, create a shortcut to
stickies.exe
, e.g.C:\Program Files\Stickies\stickies.lnk
(please note that Explorer never shows the.lnk
file extension, even when showing file extensions is enabled). In File Properties the "Start In" directory must be set correctly for this shortcut.Now, using Registry Editor, under the Run key create a new string value pointing to this shortcut file:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run Stickies="C:\Program Files\Stickies\stickies.lnk"
I did not know this was possible, but it actually works. Each time Windows starts, Stickies is launched through this shortcut. Thus it is using the right working directory, and the help file opens normally.
However, shortcut files are commonly placed on the desktop or in the Windows Start Menu, so this leaves me with a shortcut in a place where probably nobody would want it. Besides creating the shortcut file means an additional step. Therefore I looked for another, more elegant solution that is also more according to best practices.
- Method 2: register the application
By registering an application under the App Paths key in the registry it can provide information to the system about its location (and much more).
Long story short, I created a registration entries (
.reg
) file with the following contents:Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\stickies.exe] @="C:\\Program Files\\Stickies\\stickies.exe" "Path"="C:\\Program Files\\Stickies" [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] "Stickies"="C:\\Program Files\\Stickies\\stickies.exe"
Here you can see how the application including its working path is registered to the system, and below how the stickies executable is called at Windows startup. Note that if you want to apply these settings to all users, you can use HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER. Because this.reg
file makes all necessary changes when it is imported into the registry by simply double-clicking it, I keep it together with the Stickies setup file for future installations.