Junction points with network drives
Ever wanted to create a 'junction point' style pointer but using a network drive as the source? Now you can!
With Windows XP you can create junction points on your disks but the prerequisite is that the source point is on your local disk. This is no good if you need to create the junction point that refers the user from a point that is anywhere else, for example a network drive. This is actually very simple to do and has existed in Windows since Windows 98 (I think, but don't quote me on that...). All you need to do is to create a desktop.ini file and a target.lnk file and you are all done. The contents of the desktop.ini file should be:
[.ShellClassInfo]")
CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
The target.lnk file you can either create manually or use the following VBS script:
Set oWS = WScript.CreateObject("WScript.Shell")
sLinkFile = MYPATHFORFILE & "\target.lnk"
Set oLink = oWS.CreateShortcut(sLinkFile)
oLink.TargetPath = SOURCEPATHTOBEREDIRECTED
oLink.WorkingDirectory = DESTINATION
oLink.Save
The only downside is that this solution also has a prerequisite. The application that you want to follow the redirection must use Shell32.dll for it's file handling. Seeing as most applications now do this should not be too great a problem for you.
Comments
Anonymous
January 01, 2003
Ooops, sorry! You should create the files in the folder that you want to redirect. For example, if you want to redirect the network folder H:MyFolder to D:MyFolder, you put the file in H:MyFolder. Hope that makes it clearer.Anonymous
January 01, 2003
As long as the application you use makes use of Shell32.dll then it should be possible. I have used this script to redirect a network folder to a local folder with no problem. DanielAnonymous
April 26, 2008
i want to map a local folder to a remote folder(in different machines), like a remote symbolic link, i can do it?Anonymous
July 03, 2008
"create a desktop.ini file and a target.lnk" You don't say WHERE to create them.Anonymous
September 25, 2008
You should add that you have to set system attribute (attrib +s ...) to the folder and its files. And yes, you can redirect a network folder to a local folder and vice versa BUT this will not work programs that access this folder for saving data. It only works if you navigate manually to this folder (in the explorer or in some sort of "Save as"-dialogue).Anonymous
October 01, 2008
Need to also add the system attribute to desktop.ini and the target folder using the attrib command. (attrib +s [FOLDERNAME])Anonymous
January 15, 2009
Could anyone please write how to do that stuff for newbe. I dont know how use script.