0

As title says I'm trying to open a Shared Folder on File Explorer using other credentials (I already did it without using userName and Password).

Here's what I tried:

Process prc = new Process();
prc.StartInfo.FileName = Folder; // <-- Calculated string, special characters correctly escaped.
prc.StartInfo.Domain = FolderDomain; // <-- String
prc.StartInfo.UserName = User; // <-- String
prc.StartInfo.Password = Password; // <-- SecureString
prc.StartInfo.UseShellExecute = false;
prc.Start();

That code send me to Catch on "prc.Start();" with the exception message "Access denied". The question is that the user I'm trying to log as does have permissions...

Where am I making the mistake?

rwpk9
  • 304
  • 1
  • 15

2 Answers2

0

Refer this and

UNC Path. Looks you need to use UNC path to get access of network shared folder

0

SOLVED!!

I've made it work with:

Process.Start(@"C:\Windows\explorer.exe", @"\\Folder\", User, Password, UserDomain);

User and UserDomain are strings, Password is a SecureString.

rwpk9
  • 304
  • 1
  • 15