Windows Service - spaces in path causes problem?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bob

    Windows Service - spaces in path causes problem?

    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\Yel lowBanana", 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.
  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: Windows Service - spaces in path causes problem?

    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.Serv ice.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


    "bob" <bobgateaux@yah oo.com> wrote in message
    news:4c6c4857.0 411250140.5a6de a33@posting.goo gle.com...[color=blue]
    >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\Yel lowBanana", 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.[/color]


    Comment

    Working...