unc

Visual Basic 6 and UNC Paths

I'm receiving feedback from a developer that "The only way visual basic (6) can deal with a UNC path is to map it to a drive." Is this accurate? And, if so, what's the underlying issue and are there any alternatives other than a mapped drive? ...

Accessing files across the windows network with near MAX_PATH length

I'm using C++ and accessing a UNC path across the network. This path is slightly greater than MAX_PATH. So I cannot obtain a file handle. But if I run the program on the computer in question, the path is not greater than MAX_PATH. So I can get a file handle. If I rename the file to have less characters (minus length of computer name)...

IIS site on UNC share: is it problematic?

I am working with a legacy ASP Classic solution which is load balanced (via external hardware and has an IIS site the home directory of which is an UNC path. I've been told that the following issues with this setup currently exist: When using an UNC path as home directory, there is an "index" somewhere in IIS which "caches" up to a ce...

Trying to get a Windows Service to run an executable on a shared drive

I have c# that will run in a windows service. I'm trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is on the local drive, no problem. However, I need to run an executable on a shared drive. I've tried using the UNC notation (//machine_name/share_name/directory/runme.exe), but the process ...

Firefox Links to local or network pages do not work

I have a .asp application where image files (.PDF) are stored in a directory (fed by a copier/scanner). The created filenames are stored in a database table, When a query is launched from the web page a link to the file is created. When clicked the image should be displayed. This functionality works 100% in Internet Explorer. No suck lu...

File.Move not working properly for UNC paths

I'm attempting to use File.Move to move a file from one UNC location to another. This blows up if the UNC path for the destination happens to be the local machine (error: Access to the path is denied). Example File.Move(@"\someServer\path\file.txt", @"\blah2\somewhere\file.txt"). This assumes there's a network share out there somewher...

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 in the code. Has anyone done this? ...

Preserve mapped drive letter information during UAC elevation

We have an application that needs to know the path that it is executed from (which is always a network path). We set up part of our configuration based on the path that the application is launched from, and we really want that configuration to use mapped network drive paths instead of the UNC path to the resource. What we've found is t...

How do I access database via virtual folder which points at a remote share

I'm having a problem getting access to a database which lives on a remote server. I have a ASP.NET 2.0 webpage that is trying to connect to a database. The database is accessed via a virtual folder (which I set up in IIS). The virtual folder points at a remote share which contains the database. The virtual folder (in the web apps ...

Method to determine if path string is local or remote machine

What's the best way, using C# or other .NET language, to determine if a file path string is on the local machine or a remote server? It's possible to determine if a path string is UNC using the following: new Uri(path).IsUnc That works great for paths that start with C:\ or other drive letter, but what about paths like: \\machinenam...

Run a .NET program from a mapped drive or shared folder

I have written a C# Windows Forms application to merge the files and folders from a remote folder on one machine ("source" folder is a mapped drive - "Z:\folder") with another remote folder on a different machine ("destination" folder is a UNC path to a shared folder - "\\computername\sharedfolder"). I have Full permissions to both folde...

IOException reading a large file from a UNC path into a byte array using .NET

I am using the following code to attempt to read a large file (280Mb) into a byte array from a UNC path public void ReadWholeArray(string fileName, byte[] data) { int offset = 0; int remaining = data.Length; log.Debug("ReadWholeArray"); FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read); ...

What is the correct way to check if a path is an UNC path or a local path?

The easiest way to check if a path is an UNC path is of course to check if the first character in the full path is a letter or backslash. Is this a good solution or could there be problems with it? My specific problem is that I want to create an System.IO.DriveInfo-object if there is a drive letter in the path. ...

OpenTextFile on a remote computer

Hello I'm trying to read remote text files using this code: function defdate(ipaddress) deffilePath = chr(34) & "\\" & ipaddress & "\c$\" & deffileName & chr(34) wscript.echo deffilePath set deffile = objFSO.OpenTextFile(deffilePath) do while not deffile.endofstream s=deffile.readline wscript.echo s loop deffile.c...

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? ...

Accessing a UNC drive in ASP .NET?

I have two different sets of image files that reside in the root images directory of two different web sites on two different web servers. For arguments sake, let's say the first web server is called web1 and has a primary ip address of 111.111.111.111 and the second web server is called web2 and has a primary ip address of 111.111.111.1...

Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials

We've run into an interesting situation that needs solving, and my searches have turned up nill. I therefore appeal to the SO community for help. The issue is this: we have a need to programmatically access a shared file that is not in our domain, and is not within a trusted external domain via remote file sharing / UNC. Naturally, we n...

.Net DriveInfo() with UNC paths?

Good morning, is there a way to get a DriveInfo instance for UNC paths (e.g. "\fors343a.ww123.somedomain.net\folder\1\") because for example... var driveInfo = new System.IO.DriveInfo(drive); ... throws an ArgumentException ("Object must be a root directory (\"C:\\") or a drive letter (\"C\").") when using that UNC path above. What...

IIS 6 with wildcard mapping and UNC virtual directory problem

Hi. On our production servers (win 2003 with IIS6 and load balanced with an F5 BIGIP), we have a problem when introducing wildcardmapping on IIS6. We use .net Framework 3.5 SP1. The issue manifests itself as by the server only sometimes serving the images stored on a virtual directory pointing to a UNC path. Sometimes the images are di...

How can I open a UNC path from Linux in Java?

Are there any libraries available that will allow me to read from and write to a Windows Fileshare given a UNC path from Java on Linux. It's trivial on a windows box itself, and I'm aware of smbclient approaches, but I'm looking to do it by dropping in a library. Thanks. ...