Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Change Directory in Command Prompt

12 Feb 2011   #1
QuackPot

Windows 7 Professional x64
 
 
Change Directory in Command Prompt

Anyone know how to do this in command prompt?

I type "cd .." a few times to get to to C:\

Then when I type "cd e:\" I see E:\ below the command line but I'm still in C:\.


Can anyone help?

Edit: Nevermind, manage to get it working. Just had to type "E:" instead of using CD beforehand. So used to linux.


My System SpecsSystem Spec
.
12 Feb 2011   #2
Bill2

Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
 
 

CD command is only meant to change directories, not drives. If you want to change to drive E: , just type E: at the prompt.
My System SpecsSystem Spec
12 Feb 2011   #3
Kari

 

Exactly as Bill told here above. Here a bit more information.

CD (change directory) can be used to change the current, active folder (directory as it was called long time ago ) of either the current drive or another drive. If you use CD command to change active folder in another drive than where you currently are, the change can be seen next time you change the active drive.

Some examples here in the screenshot:

Change Directory in Command Prompt-cd_parameters_2.png

(Click to enlarge)

Kari


My System SpecsSystem Spec
.

12 Feb 2011   #4
logicearth

Windows 10 Pro (x64)
 
 

use the /D switch with CD to change the drive along with the path.
Code:
> cd /?
Displays the name of or changes the current directory.

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

  ..   Specifies that you want to change to the parent directory.

Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.

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

If Command Extensions are enabled CHDIR changes as follows:

The current directory string is converted to use the same case as
the on disk names.  So CD C:\TEMP would actually set the current
directory to C:\Temp if that is the case on disk.

CHDIR command does not treat spaces as delimiters, so it is possible to
CD into a subdirectory name that contains a space without surrounding
the name with quotes.  For example:

    cd \winnt\profiles\username\programs\start menu

is the same as:

    cd "\winnt\profiles\username\programs\start menu"

which is what you would have to type if extensions were disabled.
You can read about why this behavior exists here: http://blogs.msdn.com/b/oldnewthing/.../10073890.aspx

Alternatively you could update to PowerShell which is a lot more advance and newer.
My System SpecsSystem Spec
Reply

 Change Directory in Command Prompt




Thread Tools




Similar help and support threads
Thread Forum
Command Prompt: "close: No such file or directory"
I have several batch files that I need to run from Command Prompt. For exampleecho off echo !HM | ncat 192.168.1.6 80So visually I see:C:\ncat>home.bat echo off close: No such file or directory C:\ncat>All the batch files work as desired but always return the error code. ncat.exe is in the...
Software
How do I change to Basic Windows 7 theme through command prompt?
I'm having problems with my computer...isn't everyone on this forum? (excluding all you experts of course) Anyway, I accidently changed the theme to Windows Classic and it prompted a very undesirable feature. None of the programs run through Windows Explorer will load! Control Panel, My Computer,...
Themes and Styles
Change Command Prompt Default Directory
This is a simple registry hack to change the default directory you see when opening command prompt. I like to have it set to the OS root drive, but you can change it to whatever you like. This will keep you from having to use the "change directory" switch every time you open command prompt, which...
Customization
Cannot change drive in command prompt using CD
When I try to switch to D drive it stays in C: C:\Users\Valdis>cd d: D:\ C:\Users\Valdis>cd D:\Downloads C:\Users\Valdis>cd d: D:\Downloads
General Discussion
Command Prompt to change primary monitor?
Hey, I'm working on a batch file to change a system's primary monitor before launching a game. Is there a DOS command to change the primary monitor on a system? Thanks!
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:38.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App