Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In principle i can start the explorer with parameters, but this does not work with unc paths.

Now I have found here a working version to get access to remote system on the C$ share.

However, I do not want to read the C$-folder, i want to open the Windows Explorer to this path.


Connect to a UNC Path with Credentials[^]

Does anyone have any ideas on how to do this?

What I have tried:

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
string _path = textBox1.Text;
startInfo.Arguments = string.Format("/C start {0}", _path);
process.StartInfo = startInfo;
process.Start();


Works, but pretty useless without credentials.
Posted
Updated 6-Feb-22 17:58pm

1 solution

The rather lengthy code snippet at this page[^] seems like it'll do the trick. Once authenticated, you can open an Explorer window to the UCN path just by passing the UNC path as the argument with "explorer" as the Filename.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900