Tag Archives: mklink

Access virtual storage with UNC and mklink on Windows

I set up a Tomcat app server on a ‘virtual’ hard drive. The virtual drive is assigned a local hard drive letter. But when a Groovlet attempts to access a local file, the file path used is on the default local drive, C:. How to allow access to the non-local file?

Symbolic links
There are probably many ways to do this and of course corresponding security concerns. One of these is to use Universal Naming Convention (UNC) paths. My quick approach is to just use file directory symbolic links. These are supported in most windows versions. On Windows 7 the MKLINK command is available.

Example
You want to access the folder w:\a\b\c on the virtual drive. On the “real” drive you create a link:

c:
mkdir a\b
mklink /D c w:\a\b\c

Now when the app server accesses the “c” folder via a UNC, \\mymachine\a\b\c, it will find it.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.