Change Directory in Command Prompt


  1. Posts : 396
    Windows 7 Professional x64
       #1

    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 Computer


  2. Posts : 5,056
    Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
       #2

    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 Computer


  3. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #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 Computer


  4. Posts : 5,642
    Windows 10 Pro (x64)
       #4

    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; 12 Feb 2011 at 20:32.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About 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 16:13.
Find Us