1

Could anyone please advise? I want my winforms app to open a network location. The network location is password protected etc, but that should be left for the user to enter as normal.

I tried this but explorer just opens at the default page (my computer).

Process.Start("Explorer.exe", @"/select,""" + "\\\\SomeLocation\\c$\\SomeDir\\" 
 + "\"");

I also tried this but it raises an exception:

Process.Start("\\\\SomeLocation\\c$\\SomeDir\\");

I got this error

'The specified network password is not correct'

I don't want network credentials to be a part of the application.

stevepkr84
  • 1,637
  • 2
  • 13
  • 23

1 Answers1

1
Process.Start("explorer.exe", @"\\m3\c$");

Note sure if you should pass a subdirectory.

ZoolWay
  • 5,411
  • 6
  • 42
  • 76
  • I think this would work (as might the attempts I posted) if the network location did not require a un/password. The result of this code is that explorer opens in the My Documents folder. – stevepkr84 Jan 09 '14 at 11:55
  • I have checked with a server I am not logged on to and it came up that I should login - meaning the normal credentials screen comes up. Maybe it is OS-dependend how explorer.exe works this out. My test is Win7 64bit. – ZoolWay Jan 09 '14 at 14:46
  • Interesting. I am using Windows 8 64 bit. Thanks for the info. – stevepkr84 Jan 09 '14 at 14:59