I'm working on an app that uses an UNC path to access remote files in the same LAN. The problem is that when access is attempted it throws an exception related to Windows credentials.
Is there a way to add credentials to my UNC path?
Thank you
UNC path is just a special format for pointing to a folder on another computer. You first use two slashes “\\” and then the server name, \\testcomp and then another “\” followed by the shared folder path, \\testcomp\foldername. Make sure there is a tick next to “Reconnect at logon” to make the connection permanent.
Answer: A UNC path, or Universal Naming Convention, is simply a shared folder on a computer. The purpose for this folder is so when you upgrade, the registers and back office computers know where the upgrade file is and can connect to it. An example of an UNC path is \\ComputerName\SharedFolder.
The host-name portion of a UNC name can consist of either a network name string set by an administrator and maintained by a network naming service like DNS or WINS, or by an IP address.
In the windows that opens, select Computer > Map network drive. Select the drive letter for the network drive you would like to map, enter the UNC path in the Folder text field, then select Finish. The UNC path is the location of the shared folders you want to connect to.
It might be useful for you to use the NetUseAdd function from the windows api http://msdn.microsoft.com/en-us/library/windows/desktop/aa370645(v=vs.85).aspx. It allows you to access a directory through its UNC path.
Looks like Win32 APIs are the most common way to handle this. Check out this SO post Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With