Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't the system find the path specified when making a symbolic link? [closed]

Tags:

symlink

cmd

C:\windows\system32>mklink /D U:\"Mobile Apps"\Repos C:\Users\LeiceJ\Source\Repos The system cannot find the path specified.

I'm trying to set up a symbolic link so that I can access my Repository folder from the network drive. As Visual studio doesn't like network drives, I need to store things locally, but I'll be working from various computers in a network, so the only consistent file structure I'll have is the network drive. To prevent having to constantly dig through C drive folders every time I want to open anything, I want to create a symbolic link to the Repos folder.

Every time I try to create the link, I get this The system cannot find the path specified. error. The paths exist, both are correct. The only thing I can think might be throwing it off is that the link is from a network drive.

like image 692
Space Ostrich Avatar asked Aug 17 '16 03:08

Space Ostrich


People also ask

Why does it say the system Cannot find the path specified?

That's all about how to solve "The system cannot find the path specified." error while running the program from the command prompt. The root cause of this error is invalid directories, sub-directories in the PATH environment variable, just remove them and the error will be solved.


2 Answers

I think that the problem is because your link is an arborescence and that you are using the /D in place of /J, which can handle network locations.

"u:\mobile apps\repos" contains 2 folders (mobile apps & Repos)

It seems that mklink can't create 2 folders. So if you try so:

mklink /J "U:\Mobile Apps" C:\Users\LeiceJ\Source\Repos it will work.

You can also manually create a folder named "mobile apps" and then it will work.

Another point: it seems that you inverted the target with the link (but not sure). If you want to point the drive map U: as target when you enter "C:\Users\LeiceJ\Source\Repos", you need to invert the two parameters in your command.

TL;DR: Prefer mklink /J for this kind of manipulation, it handles network location.

like image 119
Guest Avatar answered Oct 10 '22 19:10

Guest


How to Resolve Issues Creating Symbolic Link Directory

I ran into this same issue when I was trying to change the backup location for my iPhone because my C:/ drive was too full and my backup took up at least 20gbs so I wanted to move it to my extra hard drive (X:/). After attempting to do this over 20 times and continuous Googling, I found this article to be VERY helpful. This was specifically for changing the back up location for devices in iTunes but the steps should be very similar.

Steps:

  1. Open File Explorer and navigate to folder location. The folder that you want to create a linked directory for should not be present. Press SHIFT key and right click in File Explorer middle view screen, you will get a pop-up menu.
  2. Select "Open command window here".
  3. Manually type in the following command where "D:\" is the new drive location (drive letter may vary) and "Backup" is the name of the folder you want to create a linked directory for.

Example: MkLink /J "%APPDATA%\Apple Computer\MobileSync\Backup" "D:\Backup"

What Solved My Issues

  • Manually typing out the cmd command above. Yes, I know, it sounds crazy. However, try actually typing it out. This resolved my issue with the "path not specified". I typed out the exact same command that I was copy/pasting and it worked only when I manually typed it out.

  • Opening the command prompt from the folder location (step 2). This also helped resolve the "path not specified" error for me.

  • Making sure the original linked directory location did not exist already as a mapped directory will be created with the same name.

For reference: I'm using a desktop PC running Windows 7 64-bit.

like image 27
Rocket Risa Avatar answered Oct 10 '22 20:10

Rocket Risa