Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Correct way to do UNC

Posted on 2013-06-08
6
Medium Priority
?
374 Views
Last Modified: 2013-06-09
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(\\COVET\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?
0
Comment
Question by:LeeLiam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 59

Expert Comment

by:Julian Hansen
ID: 39232002
The "drive letter" as you refer to it has to be a share on the remote computer - you cannot refer to a native drive without it first being shared.

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\Folder\Folder ... etc

Check the shares on COVET.
0
 

Author Comment

by:LeeLiam
ID: 39232267
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?
0
 
LVL 59

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 39232570
If public folder is shared as "Public then the UNC would be

\\Covet\Public\test.pdf
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 59

Expert Comment

by:Julian Hansen
ID: 39232571
That is assuming test.pdf is in the Public folder
0
 

Author Closing Comment

by:LeeLiam
ID: 39233149
Excellent. I guess I was trying to make it harder than it really is.

Thanks for the help.
0
 
LVL 59

Expert Comment

by:Julian Hansen
ID: 39233488
You are welcome - thanks for the help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question