March
19
Windows 7: Using mklink to move folders and programs to another drive
Symbolic links can be created in the command line with a special command that was first introduced in Vista. It is called Mklink and here is how it works for a folder:
- Before doing anything, make sure you have a backup of your system
- Move (not copy) the desired folder (let’s call it ExistingName) by the usual methods to its new destination on the X: volume. Give it whatever name you choose. Let’s call it NewName but it can retain ExistingName if you wish. At this point programs and Registry references may be broken. It is necessary to move the folder first since otherwise no symbolic link can be created on the C. drive
- Next open a command prompt with elevated privileges.
- Enter the command mklink /d C:ExistingName X:NewName The switch /d indicates that we are linking folders (directories). No switch would be used if a file was being linked. If your folder name has spaces, you have to enclose the path name in quotes.
- If a link is successfully made, the command line will show a message “symbolic link created for ExistingName <<===>> X:NewName”.
- Close the command prompt
That’s all it takes. All of the previous Registry or other references to C:ExistingName will continue to work. The command creates a small object on the C: drive that retains the previous folder name and behaves as if it has the contents of the folder that is really over on the X: drive.
By: V. Laurie