-
Notifications
You must be signed in to change notification settings - Fork 0
SymLinks (Windows)
Taken from this URL
Run cmd.exe
with admin privileges.
The basic mklink command takes arguments as: mklink Link Target
The first path after the command is called the “Link” The second path is the physical file on disk and is called “Target”
Eg: to create a symlink in the C:
drive for a text file located on the E:
drive, the command looks like this.
mklink "C:\Path\Symlink_File.txt" "E:\Path\Real_File.txt"
- or
mklink "C:\Path\Symlink_File_1.txt" "E:\Path\Sub Path\Another Level\Real_File_1.txt"
"
Symlink_File.txt
" should not exist in "C:\Path\
"
Symlinks can also be made for directories!
Add the switch /D
as a parameter in the command. (make sure the folder does not already exist in the “link” drive)
mklink /D "C:\Path\Symlink_Folder" "E:\Real_Books"
"
Symlink_Folder
" should not exist in "C:\Path\
"
- or
mklink "C:\Path\Symlink_Folder_ABC" "E:\Path\Sub Path\Another Level\Real_Folder"
Delete a symlink by selecting the link like you would a normal file or directory and hit delete. (only the link will be removed) Note however if you navigate to the target and hit delete the physical file will be deleted along with the symlink.