2

In my application, it allows users to remotely connect computers and folders within the internal network for troubleshooting, etc.

My problem is that some of these computers that they are trying to connect to haven't yet been authenticated for them, so when I plug the UNC path into a new process for explorer, it doesn't error but simply returns some random local folder (My Documents I think).

My question is... Is there a way I can make a call to the windows authentication dialog to allow the user to authenticate against the remote PC? If the user simply enters the same address into a normal explorer window, the authentication screen will appear, however, using my app it doesn't.

Is there anyway I can force this to show up for the user?

Any help appreciated, thanks.

Riples
  • 1,167
  • 2
  • 21
  • 54

1 Answers1

1

Based on this discussion:

You can have a look at CredUIPromptForCredentials API, in vb.net, just P/Invoke it. For more information:

http://www.pinvoke.net/default.aspx/credui/CredUIConfirmCredentials.html http://msdn.microsoft.com/en-us/library/aa375177(VS.85).aspx

Community
  • 1
  • 1
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
  • Thanks for the reply Neolisk. I have used your posts to now allow me to bring up the credentials dialog, but I cannot work out how to link this to prompting for a network location. For example, how can I determine if a UNC path is denied due to incorrect authentication, use the PInvoke to bring up the credentials dialog and then pass those details back into the network path. – Riples Aug 08 '14 at 01:00
  • @Riples: Check this out - http://stackoverflow.com/questions/5732347/testing-a-unc-paths-accessability. – Victor Zakharov Aug 08 '14 at 01:57