LeeLiam
asked on
Correct way to do UNC
For years, In my VB.NET Windows Application I have been storing what I thought was a UNC path as something like \\COVET\C\00a\test.pdf. Many of my users have used this naming with access from all computers on a network. Recently, I had a problem with two users. Upon testing with,
If System.IO.File.Exists(\\CO VET\C\00a\ test.pdf) = True Then
I get a path not found error even though the file is there. I started Googling UNC and it seems everyone uses \\Server\Folder\File with no drive letter. I thought perhaps the drive letter was unnecessary, but when I delete it to \\COVET\00a\test.pdf, my computer cannot find the file. This is driving me crazy.
Can someone tell me the correct way to store paths so everyone on a network can access the file?
If System.IO.File.Exists(\\CO
I get a path not found error even though the file is there. I started Googling UNC and it seems everyone uses \\Server\Folder\File with no drive letter. I thought perhaps the drive letter was unnecessary, but when I delete it to \\COVET\00a\test.pdf, my computer cannot find the file. This is driving me crazy.
Can someone tell me the correct way to store paths so everyone on a network can access the file?
ASKER
Ok, I think I get it. Yes on my Covet, the C drive is shared as C. So when you say "a share on the remote comuter", in my case it is the drive. But what I don't understand is what if the drive is not shared and the file is in the C:\Users\Public folder and it is shared. What would the UNC look like? Would it be \\Covet\Users\Public\test. pdf?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That is assuming test.pdf is in the Public folder
ASKER
Excellent. I guess I was trying to make it harder than it really is.
Thanks for the help.
Thanks for the help.
You are welcome - thanks for the help.
The exception is the hidden share of c$ - but that should be locked down and not used.
I guess you had a share on COVET C: drive shared as C and for some reason this share was removed or had security permissions changed
UNC should be \\Server\Share\Folder\Fold
Check the shares on COVET.