Setting ProcessStartInfo.WorkingDirectory to an UNC Path
Posted
by TJOHN
on Stack Overflow
See other posts from Stack Overflow
or by TJOHN
Published on 2010-04-06T17:01:23Z
Indexed on
2010/04/06
17:03 UTC
Read the original article
Hit count: 1838
I have a utility that I have written in VB.net that runs as a scheduled tasks. It internally calls another executable and it has to access a mapped drive. Apparently windows has issues with scheduled tasks accessing mapped drives when the user is not logged on, even when the authentication credentials are supplied to the task itself. Ok, fine.
To get around this I just passed my application the UNC path.
process.StartInfo.FileName = 'name of executable'
process.StartInfo.WorkingDirectory = '\\unc path\'
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
process.StartInfo.Arguments = 'arguments to executable'
process.Start()
This is the same implementation I used with the mapped drive, however using the UNC path, the process is not behaving as if the UNC path is the working directory.
Are there any known issues setting ProcessStartInfo.WorkingDirectory to an UNC path? If not, what am I doing wrong?
© Stack Overflow or respective owner