12

How to access the mapped network drives from the mingw shell? When I try

cd y: or cd /y or y:

All I get is No such file or directory or sh.exe y:: command not found.

I am able to access the same mapped Y: drive using cmd. I would like to know how to do the same using mingw shell.

yasouser
  • 313
  • 1
  • 3
  • 12

3 Answers3

11

Try cd /y/ to solve your problem

Raystafarian
  • 21,583
  • 11
  • 60
  • 89
Vinicius
  • 126
  • 1
  • 2
  • 3
    Care to explain why it works this way? – Ivo Flipse Mar 26 '12 at 13:22
  • I'm able to access the drive from mingw shell if the drive is actually connected. That is, if I double click and open the drive in Windows Explorer and then use Mingw to `cd` into it, then it works. – yasouser Mar 26 '12 at 15:00
  • 2
    Just FYI, if you're trying to access installed Windows Subsystem for Linux distributions, which are exposed as if they were network shares, you'll need to escape the `$` character. So do `cd //wsl\$/Ubuntu/home/${USER}`, for example, to access your WSL home directory (assuming Ubuntu and the same username). Microsoft uses a dollar sign in the name of this "fake" network share to avoid conflicts with existing networks, since an actual machine name can’t have a dollar sign in it. – Ryan Feeley Sep 25 '21 at 04:32
4

Try this format in MINGW64 shell (Bash for windows)

$ cd //IP_Address_of_remote_drive/Path/To/The/Folder/

Prashant
  • 41
  • 1
3

I find I have to use the mount command first. If I have a USB stick on drive E: then in the mingw shell:

mount e: /e

Only then can I run cd /e/. You can run mount without parameters to list all the currently known file systems. umount /e will remove the link between E: and /e/.

perldev
  • 31
  • 1
  • I have a "mapped network drive" as "S:" but when I run `$ mount S: /s` in MingW64 (git back) I get `mount: warning - /s does not exist.` – jacobq Nov 06 '17 at 00:55
  • 2
    It seems that my problem was that I was running git bash in elevated mode (set "Run as administrator"), and evidently the admin user didn't have an authenticated session with the file server or something like that. – jacobq Nov 06 '17 at 01:03