Wednesday, May 30, 2018

windows - Program not launching from registry run key

I have a program which I install using an NSIS script. The final step in the installer is to write to the registry Run key and have the program run on startup. I've confirmed that under


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run

exists the key


MyCompany Program - C:\MyCompany\Program\launch.vbs

I've tried the key with and without quotes but there was no impact. I have confirmed the registry is reading from CurrentVersion\Run by adding


Notepad - C:\windows\notepad.exe

and Notepad now launches at startup. The launch.vbs script is a one liner to launch a script without the cmd.exe window:


'HideBat.vbs from https://superuser.com/questions/140047/how-to-run-a-batch-file-without-launching-a-command-window
CreateObject("Wscript.Shell").Run "cmd /c " & chr(34) & "C:\MyCompany\Program\run.cmd " & chr(34), 0, True

I've confirmed calling launch.vbs from an explorer window or from cmd.exe works as I expect (launching my program). msconfig confirms that C:\MyCompany\Program\launch.vbs is listed in the startup tab. The security tab of File Properties indicates all users should have read & execute privileges. Ditto the run.cmd actually getting called.


At this point I'm at a loss as to why my program isn't being launched, and I can't figure an efficient way to debug it.


System is Windows 7 Professional 64-bit.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...