Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

App running on system startup is launching two instances

Status
Not open for further replies.

GEAK

Instructor
Feb 1, 2001
90
US
I have a utility that I've written in which I want the option to launch automatically with system startup. A much older version of this app (written when XP was still current) simply created a shortcut to itself in the Startup folder on the current user's start menu. With the advent of Vista this wasn't possible anymore.

I recently rewrote the program so that it'll work on Vista, Win7, Win8, Win10, Server 2008, 2012 & 2016. Rather than writing a shortcut to the start menu, I'm putting an entry in the registry (under HKCU\Software\Microsoft\Windows\CurrentVersion\Run) which points to the executable. The app also requests elevation in order to get the necessary permission to write to the registry.

The problem is that now, every time the system is restarted I get two instances of my app.

I've searched the registry to see if there might be an extra entry that I've inadvertently created and all I managed to find was a handful of MUI references, the Run entry that I'm creating under HKCU and another under HKU (which I'm assuming is under the GUID for HKCU).

Any suggestions as to why I'm getting multiple instances on startup would be greatly appreciated.
 
For all users, Windows+R, then type

shell:common startup

For yourself only, Windows+R, then type

shell:startup

Then drag your shortcut into that directory. I've never used the HKCU method. Sounds very complicated and not something that is easy to rmember.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top