Create directory symlinks in Windows 10
1. Create a directory symlink in Windows 10, and report an error: mklink : The “mklink” item cannot be recognized as a cmdlet, a function, a script file or a runable program name. as shown in Figure 1
PS E:\wwwroot\view\packages\theme> mklink /D E:\wwwroot\object\resources\views\theme E:\wwwroot\view\packages\theme
mklink : 无法将“mklink”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查
名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1
+ mklink /D E:\wwwroot\object\resources\views\theme E:\wwwro ...
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (mklink:String) [], CommandNotFoundE
xception
+ FullyQualifiedErrorId : CommandNotFoundException
PS E:\wwwroot\view\packages\theme>
2. The final decision to execute this command in cmd, abandon the execution in PowerShell. Tip: You don’t have enough permissions to do this. as shown in Figure 2
E:\>mklink /D E:\wwwroot\object\resources\views\theme E:\wwwroot\view\packages\theme
你没有足够的权限执行此操作。
3. Run the cmd command prompt as an administrator. as shown in Figure 3
4. Create a directory symlink successfully. as shown in Figure 4
C:\Windows\system32>mklink /D E:\wwwroot\object\resources\views\theme E:\wwwroot\view\packages\theme
为 E:\wwwroot\object\resources\views\theme <<===>> E:\wwwroot\view\packages\theme 创建的符号链接
5. The theme already exists under the directory: e:\wwwroot\object\resources\views, and its properties are: e:\wwwroot\view\packages\theme. in line with expectations. as shown in Figure 5




