Score:1

Emulate local directory as network drive

ru flag

Is there a way to map a local directory in Windows 10 as a network drive? I want to map C:\datastore as if it were \\datastore . Although there is plenty of information on mapping a network drive to a local drive I'm basically wanting it to go in the other direction.

For background I'm testing a piece of compiled software that is currently throwing an exception while trying to read data from a file. I have access to the source code and can see that it's trying to reference a file on a hard-coded network drive. I don't have access to the network drive from my computer, though I was able to retrieve the file through other means and add it to a local folder. I want to test the software as it written without modifying the source code to refer to the local drive or relative path.

I tried mklink /D \\datastore C:\datastore and received The specified path is invalid.

Score:3
cn flag

UNC uses the following format: \\servername\resource\pathname

For example, to access the file test.txt in the directory "examples" on the shared server "example", you would look like this: \\example\examples\test.txt

Knowing this, its clear that a UNC folder path to simply \\folder is not possible. It is, indeed, a perfectly valid server name, as it points to server "folder" - but not as a ressource (which can be folder, but also a printer or named pipe).

But you can set up file sharing on your machine, create a share from 'datastore' and use \\your-machine\datastore as a path. You could also rename your machine to match hard coded request names.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.