2

I'm trying to make a symlink for a steam game saves dir to my documents dir which I'm backing up (and want these saves there). Running Windows 10 10.0.18363

Running CMD in admin mode with the following command

mklink /D "C:\Users\mpw\Documents\Evil Genius saves" "C:\Program Files (x86)\Steam\steamapps\common\Evil Genius\DynamicResources\Layouts"

Returns the error: "The system cannot find the file specified."

I can create a symlink to other locations for this target directory without issue. Can anyone shed light on what's going on here, thanks

1
  • As below: After doing more reading I found it was windows defender blocking the action. I was stumped at first because by all accounts in the documentation the command was correct. Go into windows security -> virus & threat protection -> protection history -> "protected folder access blocked" - allow this action
    – magnet
    May 18, 2020 at 20:04

2 Answers 2

3

For use mklink in you Windows, read the information on ss64.com about.

Elevation

  • By default, only Administrators can create symbolic links. The security setting 'Create symbolic links' can be granted at: Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\*

  • Creating a symbolic link requires elevation, but from Windows 10 build 14972, symlinks can be created without needing to elevate the console as administrator - this does however require that you have Developer Mode enabled.

So, you can enable Developer Mode enabled

enter image description here

enter image description here

enter image description here

I prefer to apply a boot after any changes made to the system settings, this is my habit, so I restarted and typed:

C:\Users\ecker>mklink /D "%userprofile%\Documents\Call of Duty Black Ops II Saves" "C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops II\players"
symbolic link created for C:\Users\ecker\Documents\Call of Duty Black Ops II Saves <<===>> C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops II\players
C:\Users\ecker>mklink
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    Specifies the new symbolic link name.
        Target  Specifies the path (relative or absolute) that the new link
                refers to.

Obs.: You can also activate Developer Mode for Windows 10 using PowerShell, also for cmd command line or batch file:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

2
  • Thank you for the help. After doing more reading I found it was windows defender blocking the action. I was stumped at first because by all accounts in the documentation the command was correct.
    – magnet
    May 18, 2020 at 20:03
  • @magnet Thank you too! Good question this one!
    – Io-oI
    May 18, 2020 at 20:11
0

I wanted to add that I ran into this issue as well (Windows Defender blocking me from Symlinking documents in certain folders). I used the All-Users Current-Host profile path instead, and that seems to work well.

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jan 17, 2023 at 17:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .