How to Create Symbolic Links to Shared Folders
You can create symbolic links on the local file system to files stored on other local drives or shared folders. However, when you use the mklink command, you must always specify the absolute path to the remote target file because the mklink command by default assumes that the location is relative. For example, suppose you want to create a symbolic link named C:\Link.txt that targets a file on a shared folder at Z:\Target.txt. If you run the following commands, you will successfully create a symbolic link at C:\Link.txt.
C:\>Z: Z:\>mklink C:\link.txt target.txt
However, that file will link to C:\Target.txt and not the intended Z:\Target.txt. To create a link to the Z:\Target.txt file, you need to run the following command.
C:\>mklink C:\link.txt Z:\target.txt
The mklink command also allows you to create a symbolic link targeting a Universal Naming Convention (UNC) path. For example, if you run the following command, Windows will create a symbolic link file called Link.txt that opens the Target.txt file.
Mklink link.txt \\server\folder\target.txt
If you enable remote symbolic links (discussed later in this section), they can be used to store symbolic links on shared folders and automatically redirect multiple Windows network clients to a different file on the network.
By default, you can use symbolic links only on local volumes. If you attempt to access a symbolic link located on a shared folder (regardless of the location of the target) or copy a symbolic link to a shared folder, you will receive an error. You can change this behavior by configuring the following Group Policy setting:
Computer Configuration\Administrative Templates\System\NTFS File System\Selectively Allow The Evaluation Of A SymbolicLink
When you enable this policy setting, you can select from four settings:
- Local Link To Local Target Enabled by default, this allows local symbolic links to targets on the local file system.
- Local Link To Remote Target Enabled by default, this allows local symbolic links to targets on shared folders.
- Remote Link To Remote Target Disabled by default, this allows remote symbolic links to remote targets on shared folders.
- Remote Link To Local Target Disabled by default, this allows remote symbolic links to remote targets on shared folders.
Enabling remote links can introduce security vulnerabilities. For example, a malicious user can create a symbolic link on a shared folder that references an absolute path on the local computer. When a user attempts to access the symbolic link, he will actually be accessing a different file that might contain confidential information. In this way, a sophisticated attacker might be able to trick a user into compromising the confidentiality of a file on his local computer.
In this tutorial:
- Managing Disks and File Systems
- Overview of Partitioning Disks
- How to Choose Between MBR or GPT
- Converting from MBR to GPT Disks
- GPT Partitions
- Choosing Basic or Dynamic Disks
- Working with Volumes
- How to Create a Simple Volume
- How to Create a Spanned Volume
- How to Create a Striped Volume
- How to Resize a Volume
- How to Delete a Volume
- How to Create and Use a Virtual Hard Disk
- File System Fragmentation
- Backup And Restore
- How File Backups Work
- File and Folder Backup Structure
- How System Image Backups Work
- How to Start a System Image Backup from the Command Line
- How to Restore a System Image Backup
- System Image Backup Structure
- Best Practices for Computer Backups
- How to Manage Backup Using Group Policy Settings
- Previous Versions and Shadow Copies
- How to Manage Shadow Copies
- How to Restore a File with Previous Versions
- How to Configure Previous Versions with Group Policy Settings
- Windows ReadyBoost
- BitLocker Drive Encryption
- How BitLocker Encrypts Data
- How BitLocker Protects Data
- TPM with External Key (Require Startup USB Key At Every Startup)
- TPM with PIN (Require PIN At Every Startup)
- TPM with PIN and External Key
- BitLocker To Go
- BitLocker Phases
- Requirements for Protecting the System Volume with BitLocker
- How to Enable the Use of BitLocker on the System Volume on Computers Without TPM
- How to Enable BitLocker Encryption on System Volumes
- How to Enable BitLocker Encryption on Data Volumes
- How to Manage BitLocker Keys on a Local Computer
- How to Manage BitLocker from the Command Line
- How to Recover Data Protected by BitLocker
- How to Disable or Remove BitLocker Drive Encryption
- How to Decommission a BitLocker Drive Permanently
- How to Prepare AD DS for BitLocker
- How to Configure a Data Recovery Agent
- How to Manage BitLocker with Group Policy
- The Costs of BitLocker
- Windows 7 Encrypting File System
- How to Export Personal Certificates
- How to Import Personal Certificates
- How to Grant Users Access to an Encrypted File
- Symbolic Links
- How to Create Symbolic Links
- How to Create Relative or Absolute Symbolic Links
- How to Create Symbolic Links to Shared Folders
- How to Use Hard Links
- Disk Quotas
- How to Configure Disk Quotas on a Single Computer
- How to Configure Disk Quotas from a Command Prompt
- How to Configure Disk Quotas by Using Group Policy Settings
- Disk Tools
- EFSDump
- SDelete
- Streams
- Sync
- MoveFile and PendMoves