Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7 - Change Directory in Command Prompt

 
02-12-2011   #1


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
02-12-2011   #2


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
02-12-2011   #3


 


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
.


02-12-2011   #4


Windows 7 (7600) x86
 
 


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.

Last edited by logicearth; 02-12-2011 at 08:32 PM..
My System SpecsSystem Spec
Reply

 Change Directory in Command Prompt problems?



Thread Tools



Similar Threads for: Change Directory in Command Prompt
Thread Forum
Change Command Prompt Default Directory Customization
Run administrative command prompt from command prompt General Discussion
Solved Cannot change drive in command prompt using CD General Discussion
Change time to display OS from installation disk command prompt Installation & Setup
Command Prompt to change primary monitor? General Discussion


All times are GMT -5. The time now is 10:10 PM.



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
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30