I am trying to use Process.Start to open a folder using explorer on the click of a window.
It works fine on the first two clicks of the button i.e. the folder is opened and on closing the windows and click on the button a third time gives the error message
"the path "C:\test" is not found or is not a directory"
If anyone has any info on how to solve it, please share..
Dim myProcess As Process = New Process()"""" + ServerPath + """"
myProcess.StartInfo.UseShellExecute = False
I have tried both setting UseShellExecute to False and True
this works well if the folder is on my local computer.
But the same problem repeats if the folder is a network folder.
1. First time on the button click, folder is opened in explorer window. Close the window
2.Click on the button second time, folder is again opened in expoerer window. Close the window
3.CLick on the button a third time, get an error message
THE PATH "\abcd\xyz\" does not exist or is not a directory
4. Navigate from that windows form to a different form and come back again to the first form and click on the button, the folder opens (after 2 attempts, the same error message is repeated. The cycle repeats)
I have even tried this
but the same error message repeats on the third attempt