Search code examples
windowsregistrystartupbootautostart

EXE path in HKEY_LOCAL_MACHINE\...\Run doesn't launch


I added a string value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run, called MyAppName, with its value of its full path, say C:\Temp\MyAppName.exe.

I restarted, but it wasn't started, and I have no idea why. When I use the same path from command-line it starts (after receiving the elevation approval).

As implied, this app asks for elevation when it starts, FWIW...

I use Win8.1 64 bit


Solution

  • You need to create a non-UAC wrapper. This can show a simple dialog (e.g. "Start Acme.Inc Widgelator? Yes/No"). You should show the UAC shield on the Yes button.

    The usual case for such a UAC-at-startup scenario is an version check. You should do the version check without admin rights and only prompt for elevation if an update is in fact available.