Questions tagged [unc]

A UNC path unambiguously specifies the location of a volume, directory, file or other local or remote resource on Windows.

On Windows, a UNC path specifies the location of a local or remote resource, including files, directories, volumes and more. UNC path generalize traditional file paths. A UNC path has the form \\Hostname\Folder\Resource. A UNCW path (long UNC) has the form \\?\UNC\Hostname\Folder\Resource.

593 questions
19
votes
4 answers

How can I determine if a string is a local folder string or a network string?

How can I determine in c# if a string is a local folder string or a network string besides regular expression? For example: I have a string which can be "c:\a" or "\\foldera\folderb"
user526731
  • 191
  • 1
  • 1
  • 3
18
votes
1 answer

How to access Network Share from Raspberry Pi running IoT Core in UWP app

I have a c# UWP app that I'm intending to run on a Raspberry PI with Windows 10 IoT Core. The problem I have is when I try to connect to a UNC share to copy some files. The network is just a home network with local user credentials, share is on…
Paul Charlton
  • 371
  • 2
  • 10
15
votes
4 answers

The host '...' was not found in the list of allowed hosts. Do you want to open it anyway?

Since updating to Visual Studio Code v. 1.78.2 this warning has been popping up. It is appearing because the folder I am working out of is using a UNC path. I rely on this path. The VS help page states: configure the host to be allowed via the…
Pfalbaum
  • 586
  • 3
  • 10
  • 26
15
votes
2 answers

python copy files to a network location on Windows without mapping a drive

I am running python in a non interactive session on windows and therefore I cannot map a network drive. Most of what I have researched on here and through google everyone suggests mapping a network drive and copying the files that way. On linux I…
pablo
  • 473
  • 1
  • 6
  • 14
14
votes
3 answers

Python 2: Get network share path from drive letter

If I use the following to get the list of all connected drives: available_drives = ['%s:' % d for d in string.ascii_uppercase if os.path.exists('%s:' % d)] How do I get the UNC path of the connected drives? os.path just returns z:\ instead of…
Robben_Ford_Fan_boy
  • 8,494
  • 11
  • 64
  • 85
14
votes
3 answers

How can I mount a windows drive in Java?

We are working with some legacy code that accesses a shared drive by the letter (f:\ for example). Using the UNC notation is not an option. Our Java wrapper app will run as a service, and as the first step, I would like to map the drive explicitly…
Brett McCann
  • 2,469
  • 2
  • 27
  • 44
13
votes
3 answers

How do I convert a path with a drive letter to a UNC path

How do I convert a path with a drive letter like W:\Path\Share to the equivalent unc path like \\server\Share\File in .Net? At the command prompt you can run net use and that will list the mappings. How do I get at that info in .Net?
Iain
  • 2,500
  • 1
  • 20
  • 24
12
votes
1 answer

Read/Writing files in node with fs via UNC path

Having issues of reading/writing to a UNC path with nodeJs on my local machine. At one point fs was read/writing from my machine to the UNC path just fine, but now it appears that it cannot read/write to it. UNC Path : \\[machine…
afreeland
  • 3,889
  • 3
  • 31
  • 42
12
votes
1 answer

Physical, Relative, Absolute and other paths

I have a task to write an object that can receive a different type of paths/urls, and return what type of path/url it is. For example the path can be 1. [drive]:\Temp 2. \\Temp 3. Temp (assuming that it relative Temp), 4. /Temp 5. ~/Temp 6.…
Alex Dn
  • 5,465
  • 7
  • 41
  • 79
12
votes
2 answers

C#: How to logon to a share when using DirectoryInfo

If I want to instantiate a DirectoryInfo object with an UNC path DirectoryInfo myDI = new DirectoryInfo (@"\\server\share"); how can I pass a username / password that is required to access that share? Thanks
user150898
11
votes
4 answers

Network Authentication when running exe from WMI

I have a C# exe that needs to be run using WMI and access a network share. However, when I access the share I get an UnauthorizedAccessException. If I run the exe directly the share is accessible. I am using the same user account in both…
Andy
  • 307
  • 4
  • 13
10
votes
4 answers

Get UNC path from a local path or mapped path

In Delphi there is a function ExpandUNCFileName that takes in a filename and converts it into the UNC equivalent. It expands mapped drives and skips local and already expanded locations. Samples C:\Folder\Text.txt ->…
Chris J
  • 2,160
  • 4
  • 16
  • 23
9
votes
2 answers

C# opening unavailable network path with Process.Start()

I'm opening directories over network using: System.Diagnostics.Process.Start(path); // path = UNC network path But having 2 network paths: \\This_PC_Does_Not_Exist\dir \\This_PC_Is_Turned_Off\dir How come first one takes very fast to verify that…
yosh
  • 3,245
  • 7
  • 55
  • 84
9
votes
1 answer

UNC path pointing to local directory much slower than local access

Some code I'm working with occasionally needs to refer to long UNC paths (e.g. \\?\UNC\MachineName\Path), but we've discovered that no matter where the directory is located, even on the same machine, it's much slower when accessing through the UNC…
Chris Doggett
  • 19,959
  • 4
  • 61
  • 86
9
votes
1 answer

cygwin - file copy to UNC share

First, I know absolutely nothing about CYGWIN so bear with me... Our developers need to procure some text dumps from our DBAs. They work with Oracle on Windows via a CYGWIN environment, and kornshell. Question: How can we use kornshell/cygwin to…
one.beat.consumer
  • 9,414
  • 11
  • 55
  • 98
1
2
3
39 40