Nov 14 2006
Service Path To Executable
Today I’ve been editing and testing a Windows Service application. I’ve got my system setup so that whilst running in debug mode the application runs as a command line application, so that the debugger automatically connects to it rather than me having to manually connect the debugger to the service every time I want to test my code.
When I switch to Rlease mode the application gets compiled as a service and is automatically started using a post-build action. This is where I ran into a problem. Its been a while since I last ran the service on my machine and the release exe location has changed since then and the service starter complained about to path to exe being incorrect. I could have re-installed the service but I thought it would be easier (and better) to change the location of the currently installed exe.
This is a lot easier than it sounds and can be accomplished with the good ole regedit. Just click on Start Menu -> Run and enter “Regedit” (sans quotes). Then you need to navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\[Name of Service]. To change the location of the exe just change the ImagePath key.
Please note that directly editing the registry with Regedit can completely balls up your machine and prevent it from starting. If in doubt seek professional help, so you can blame someone else if it all goes tits-up.
Thanks for this tip!
I used your advise to change the path for BackupExec services which did not update after an upgrade. It worked perfectly. Thank you!
Thanx a lot.
It worked perfectly.
thanx again
A simple solution to a seemingly unsolvable problem. Thanks!
Really great tip! Thanks for the help!
Thanks for this great Hint. This was exactly what I was searching for. I could edit the Path.
Thank you, it helps me !
Thanx a bunch for this tip, helped me out with Oracle DB services, which, to be honest, are a mess. Especially when you reinstall the database instance, whoever tried this once knows what I’m taking about here
thanks, worked really well
Great help; thanks
It helped, thanks!
let me thanx for you are big help.
I was having a problem installing a printer each time it would say print spooler not running. When I tried to start the spooler it would say can’t find the path. I was able to set the path which was blank using your method and it worked perfectly. Thanks what a great help!
Worked for me too, thanks. Used it for changing the service path for MS SQL Server Analysis Services that someone had set to include a -s config switch … which didn’t work so well when we tried to get rid of that volume.
[...] http://www.gringod.com/2006/11/14/service-path-to-executable/ [...]
Thanks man for your help.
Thanks!
THANK YOU THANK YOU! Used your post to move MS OLAP\Config!
thanks. still benefitting from this post.
[…] Needed) Change the Service path to the MyService.exe that is produced in your Solution’s bin […]