Symbolic Links in Windows 100

Windows has an unfortunate tendency to create user profiles in the format ${firstName} ${lastName} upon account creation. The space between the first and last names can cause significant problems for a variety of software engineering techniques, including the use of ESLint for this module. Changing the name of your profile or user folder is problematic due to all of the registry modifications necessary for such an operation, and Windows will not recognize a simple shortcut to your user folder either.

You do not have to create an entirely new profile to address this defect though. Instead, we will create a symbolic link.

  1. Identify the path to your user folder; this folder should be in C:\Users and match your name.

  2. Open a Command Prompt with administrative privileges1.

    2.1. Open the *Start Menu

    2.2. Type in cmd.

    2.3. Right-click on the Command Prompt entry that appears.

    2.4. Select Run as Administrator from the context menu that appears.

  3. In the Command Prompt that appears, type in mklink /j ${link} ${target}2 where:

    3.1. link is the path to the symbolic link you wish to create (a link to the actual user folder); this should not include any spaces.

    3.2. target is the path to your existing user folder.

    3.3. For example, mklink /j "C:\Users\bsogata" "C:\Users\Branden Ogata" will create a symbolic link bsogata in the C:\Users directory pointing to C:\Users\Branden Ogata.

  4. You should now see a new shortcut in C:\Users with the name you chose representing the symbolic link that you created.

  5. Find the .npmrc file in your user folder and change all references to your user name to the name of the new symbolic link you created.


0: The author of this reading was raised in Seattle and therefore has a slight bias toward Microsoft products. Please account for this when reading and ignore any sarcasm where sarcasm does not appear to be a significant component of the reading.

1: Yes, this would just be sudo on a UNIX-based terminal. Switching to Ubuntu is in fact an alternate solution to this problem.

2: Template literals are still great.