2

Considering this code:

    Process process = new Process();
    process.StartInfo.FileName = "explorer";
    process.StartInfo.Arguments = "\\some_network_host\path";
    process.Start();

I would like to connect to a shared resource and open the path in Explorer.exe, however, the user might not be authenticated yet. If the user is not authenticated, I would like to open a Windows authentication popup just like the one I see when I run \\some_network_host\path, however, my actual code just opens "My Document" instead (if the user is not already authenticated). If the user is already authenticated, it opens the explorer.exe window showing the shared resource. Thank you.

evg02gsa3
  • 571
  • 5
  • 17

1 Answers1

3

This code works fine for me

Process process = new Process();
process.StartInfo.FileName = @"\\existing_network_host\path";
process.StartInfo.UseShellExecute = true;
process.StartInfo.ErrorDialog = true; 
process.Start();

The keey difference is true value for StartupInfo.ErrorDialog

vitalygolub
  • 735
  • 3
  • 16