Windows Service - spaces in path causes problem?

B

bob

I have created a simple Windows service in VB.Net which installs fine
using InstallUtil.exe to install it to, for example "c:\test", or
"c:\Windows\YellowBanana", but if I install it to "c:\Program
Files\Test" it installs ok but will not start (no useful error message
is given other than the usual annoying suggestion about having
sufficient privileges).

The problem only seems to happen with spaces, not long filenames.

I have found a couple of references on the web to people having found
the same problem but not enough to suggest to me that this is a
definite "feature". Anybody else found that they can/cannot install
services with spaces in the path?

Thanks,
John.
 
J

Jay B. Harlow [MVP - Outlook]

Bob,
Which version of the OS? Which version of .NET?

Using both Windows XP & Windows Server 2003 along with .NET 1.1 (with &
without SP1) I have Windows Services that run with spaces in the path name,
such as "\Program Files\My Company\My.Service.exe". However! I've been using
a setup project instead of calling InstallUtil directly.

Do you have the same problem if you use a setup project?

Do you have the same problem if you chdir to the folder where the service
is?

Do you have the same problem if you specify the full path to the service
when calling InstallUtil?

Do you have something in your code that is choking on the space in the path?
(In other words, do you have the same problem with a minimalist Windows
Service?)

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top