Error "Invalid directory name" in Process.Start?

I am writing a launcher, and when I go to start the process, I get an "Invalid directory name" error. Here is the code that starts the process:

Const DEBUG_ROOT = _ 
"Z:\Kiosk_JC\KioskSignIn.root\KioskSignIn\KioskSignIn\KioskSignIn\bin\Debug"

Dim oKiosk As New System.Diagnostics.Process
oKiosk.StartInfo.UserName = oEnc.Decrypt(Username)
oKiosk.StartInfo.Password = oEnc.DecryptSecure(Password)
oKiosk.StartInfo.Domain = oEnc.Decrypt(Domain)
''// The AddBS function appends a '\' to the passed string if it is not present
oKiosk.StartInfo.WorkingDirectory = AddBS(DEBUG_ROOT)
oKiosk.StartInfo.FileName = "KioskSignIn.exe"
oKiosk.StartInfo.UseShellExecute = False
Dim proc As Process = Nothing
proc = System.Diagnostics.Process.Start(oKiosk.StartInfo)

      

I saw another question here: I needed to install WorkDirectory (before I started looking, I was getting an error). Although I have this property, I am still getting the error. Any thoughts?

More details

I should also note that my Z: \ is on my network. I have a function that resolves a UNC path. When I run this function on DEBUG_ROOT I get the same error.

I tried moving the app to c: \ kiosk. The same result. I am logged in as a user, I impersonate myself, so I have access to all shared folders and files.

Here is the link, for whatever reason the url generation wants to use all the text after the link:

Posted post

+1


a source to share


3 answers


Drives mapped for each user. You are probably starting the process with a different user.



+2


a source


It looks like the process cannot see the Z: drive or has no security access. In what user context does the application run? The Z: drive may not be available in this context.



0


a source


I got the same error as you. most likely the user you are using to start the process does not have access to the specified resource (exe file)

try moving the exe to a different location and / or giving the user permission to access the file.

0


a source







All Articles