How to view remotely mapped drive in the Windows command line

0

I'm using Expandrive 3 to map a remote drive to the Z:\ drive on my computer. I would like to view it using the command line from Windows 7, but trying cd Z:\ doesn't do anything. No error message, nothing.

Does anyone know if there's a way to view a drive other than C:\ using the command line in Windows?

avorum

Posted 2014-06-16T14:35:58.207

Reputation: 227

Your question doesn't make sense. What is a mapped drive to a remote drive? Do you mean a mapped drive to a remote Share? Have you tried simply running CD Z:? How about running net use? Do you see the Z: drive? – joeqwerty – 2014-06-16T14:46:12.117

I can see the remote drive. running CD Z: outputs the text "Z:" and that's it. – avorum – 2014-06-16T14:47:46.067

have you typed 'dir'? – Frank Thomas – 2014-06-16T14:49:18.903

well, like i said, the CD command didn't do anything. If I run 'dir' after trying to CD it still returns the contents of my home folder. – avorum – 2014-06-16T14:51:13.327

type z: without the backslash and hit enter – Frank Thomas – 2014-06-16T14:52:28.553

Type Z: at the command prompt and hit enter. You should then be in the Z: drive. Type dir to confirm that the directory contents are those of the Z: drive. – joeqwerty – 2014-06-16T14:54:06.080

Just type Z:, no cd and no slash. The cd command is for changing directories not drives. – Jason C – 2014-06-16T15:25:40.950

Its worth noting that powershell does CD to other drives in one operation. I don't tend to use cmd.exe much anymore, since PS is just generally better and it recognizes standard bash FS commands like ls. – Frank Thomas – 2014-06-16T15:27:53.433

Answers

4

This is not specific to network shared drives. This is the normal behavior of cd command under windows. You should read the contents of the help notes provided with cd command. A quote from cd help notes:

Use the /D switch to change current drive in addition to changing current directory for a drive.

The syntax you want is

CD [/D] [drive:][path]

This will allow you to cd to a different drive. If /D switch is not used, you can only change the directory within your current drive.

Another alternative is to explicitly change the drive before issuing cd command. in your case this would look like this

[drive:]

CD [path]

First line will change the drive to whatever drive you want, use Z: in your case (note no backslash after column), second line will change directory to [path]

Art Gertner

Posted 2014-06-16T14:35:58.207

Reputation: 6 417

2

When cd'ing to a drive, older versions of cmd.exe do not go straight there. after issuing your CD command, type the drive letter : but without a backslash. The reason is because CD is only for changing directories, not drives, and they technically have differant syntax. you don't actually need to CD at all to just switch drives

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    C:\Users\user>cd d:\

    C:\Users\user>d:

    d:\>c:

    C:\Users\user>

Frank Thomas

Posted 2014-06-16T14:35:58.207

Reputation: 29 039

1

The cd command (without /D switch) cannot change current working directory to another drive. For that use X: command (where X is a drive to change to).

The cd X:\path does not do nothing though. It changes current directory on X: drive to path. So if you do cd X:\path followed by X: you end up in X:\path. Every drive in Windows remembers its working directory. The X: command does not change to a root directory of the drive, but to a working directory on the drive (root being default).

Martin Prikryl

Posted 2014-06-16T14:35:58.207

Reputation: 13 764

1

Yes, the /D swtich for CD will change the drive and then change the current working directory.

This works with both drive letters assigned to local drives and also to network drive letters mapped to network UNC shares or remote storage servers via programs like ExpanDrive or WebDrive.

More information on the MSDOS CD command can be found at http://www.computerhope.com/cdhlp.htm

WebDrive

Posted 2014-06-16T14:35:58.207

Reputation: 31

Would be helpful to have the relevant information from the external link. – Ramhound – 2015-04-03T01:26:42.020