Re: ProcessStartInfo.WorkingDirectory and Mapped Network Drives



When a windows service starts, no one is logged into the computer. Until
someone logs in, there are NO mapped drives! So, you will have to use UNC
paths (//server/share1/dir1).
Bob

"mhetherington" <mhetherington@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D1961D07-866B-4753-99E0-01EC564E2D78@xxxxxxxxxxxxxxxx
Just discovered a critical piece of the puzzle...

The Start() method fails, as described below, only when running as a
Windows
Service. When I try the same thing from s straight Console App while
logged
in as the service account user, Start() succeed. However, when running as
a
Windows Service it doesn't seem I can set WorkingDirectory to any mapped
drives...even though I have confirmed that the mapped drive does exist and
is
accessible to the service account.

So, a refinement of my question should read "Has anyone successfully set
ProcessStartInfo.WorkingDirectory to a mapped network drive while running
as
a Windows Service?"

"mhetherington" wrote:

Has anyone successfully called the Start() method on a
System.Diagnostics.Process object with the object's
ProcessStartInfo.WorkingDirectory set to a path on a mapped network
drive?

For example, if I have "w:" mapped to "\\serverA\share1" and set
ProcessStartInfo.WorkingDirectory = "w:\dir1", my calls to
Process.Start()
always fail with the error "The directory name is invalid".

Whereas, if I do the same thing with WorkingDirectory = "c:\dir1", calls
to
Process.Start() always succeed.

Before anyone asks, yes the directory "dir1" does exist on w: and is
readable under the user context calling the Process.Start() method.

If no one has successfully executed Process.Start() with WorkingDirectory
pointing to a mapped network drive, does anyone have any (MS) reference
article confirming that this is not possible and perhaps explaining why?

Thanks in advance.


.



Relevant Pages

  • Re: ProcessStartInfo.WorkingDirectory and Mapped Network Drives
    ... A windows service runs with no users logged ... Mapped drives are attached to logged on users. ... In the service's OnStartevent, the first thing I do is map a network ... Startmethod of the Process object executes just fine. ...
    (microsoft.public.dotnet.framework)
  • Re: How do I free "ghosted drives"?
    ... My server has drives G: thru Z: free under console windows. ... Windows Service program using the -debug switch under cmd console window, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: GetLogicalDrives function does not return mapped drives
    ... System.io.Directory.GetLogicalDrives from a Windows service, ... I also tried WMI WIN32_MappedLogicalDisk, ... Any ideas why GetLogicalDrives does not return my mapped drives when ... 26 drive letters system-wide. ...
    (microsoft.public.dotnet.framework)
  • 1A Windows Service must be installed on Windows Partitiion
    ... Server that you can't install a Windows Service to any other ... The serive immediately calls a COM object at startup, ... the partions for additional hard drives are mounted? ...
    (microsoft.public.windows.server.setup)
  • Re: Mapped Network Drive Removal from List
    ... > The MY COMPUTER folder on my laptop shows several mapped network ... > drives that are no longer extant. ...
    (microsoft.public.windowsxp.help_and_support)