zeraDev
zeraDev

Reputation: 411

Windows doesn't launch my software on startup

I would like to add a program called "itManager" to windows startup using registry entry. So i have add the needed keys to the windows registry,as read on Stackoverflow threads about the subject. Here is a dump:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"BCSSync"="\"C:\\Program Files\\Microsoft Office\\Office14\\BCSSync.exe\" /DelayServices"
"itManager"="C:\\Program Files\\itManager\\bin\\itManager.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\itManager.exe]
"Path"="C:\\Program Files\\itManager\\bin"
@="C:\\Program Files\\itManager\\bin\\itManager.exe"

But my itManager.exe is not lauched. In fact i guess that Windows start the program but not from the needed directory causing the software to quit immedatly (if itManager.exe is not launch from C:\Program Files\itManager\bin\, it failed).

And i don't know where to look to understand whats going on... I have tried Windows logs but without success.

So i dont know how to debug this.

Thanks,

Upvotes: 0

Views: 2113

Answers (3)

Zumyl
Zumyl

Reputation: 1

It will work if you add start/d like this :

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"ITM"="Cmd.exe /c start \"Itm\" /d \"c:\\Program Files\\itManager\\bin\" \"itManager.exe\""

Or in a batch file :

reg add "hkcu\Software\Microsoft\Windows\CurrentVersion\Run" /v "ITM" /t reg_sz /f /d "Cmd.exe /c start \"Itm\" /d \"c:\Program Files\itManager\bin\" \"itManager.exe\""

Upvotes: 0

LittleSweetSeas
LittleSweetSeas

Reputation: 7054

If your guess is correct, you could try to launch it via a batch file (.bat).

Create a new file with a text editor, name it itManager.bat. Edit it this way:

echo off
cd C:\Program Files\itManager\bin\
itManager.exe

Now launch this file at the startup instead of your .exe, and it will executes the .exe from the correct folder.

I don't know if there is a cleaner way to run a program by registry from a different folder, but this should work.


Edit: i think the only way to hide the splashing console window is by scripting the launch of your batch.

Again, in a text editor, put these lines:

Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "C:\yourPath\yourBatchName.bat" & Chr(34), 0
Set WshShell = Nothing 

and save with .VBS extension. Now run this last file in your registry entry.

Upvotes: 2

mzzzzb
mzzzzb

Reputation: 1452

what i would suggest is create a shortcut to itmanager.exe in your startup folder.

You will find Startup group in your Start menu Right click -> open (Open All users if you want the program to start for all users) it and create a shortcut to Itmanager.exe, you can edit the shortcut properties to set the starting directory

Upvotes: 0

Related Questions