Command prompt won't change directory to another drive

后端 未结 11 2137
你的背包
你的背包 2020-12-04 04:16

I\'m trying to compile some java (learning java currently), and to do so I need to change command-prompt\'s directory (using javac).

C:\\...\\Admin> cd D:         


        
相关标签:
11条回答
  • 2020-12-04 04:55

    I suppose you are using Windows system.

    Once you open CMD you would be shown with the default location i.e. like this

    C:\Users\Admin - In your case its admin as mentioned else it will be the username of your computer

    Consider if you want to move to E directory then simply type E:

    This will move the user to E: Directory. Now change to what ever folder you want to point to in E: Drive

    Ex: If you want to move to Software directory of E folder then first type

    E:

    then type the location of the folder

    cd E:\Software

    Viola

    0 讨论(0)
  • 2020-12-04 04:59

    you should use a /d before path as below :

    cd /d e:\
    
    0 讨论(0)
  • 2020-12-04 05:00

    The cd command on Windows is not intuitive for users of Linux systems. If you expect cd to go to another directory no matter whether it is in the current drive or another drive, you can create an alias for cd. Here is how to do it in Cmder:

    • Go to $CMDER_ROOT/config and open the file user_aliases.cmd
    • Add the following to the end of the file:
    cd=cd /d $*
    

    Restart Cmder and you should be able to cd to any directory you want. It is a small trick but works great and saves your time.

    0 讨论(0)
  • 2020-12-04 05:02

    The directory you're switching to is on another drive, you need to switch to that drive using :

    C:\...\Admin> d:
    

    then you can cd into the directory you want.

    C:\...\Admin> d:
    D:\>cd "Docs\Java"
    
    D:\Docs\Java>
    
    0 讨论(0)
  • 2020-12-04 05:06

    The short answer

    The correct way to go from C:\...\Adminto D:\Docs\Java drive, is the following command :

    cd /d d:\Docs\Java
    

    More details

    If you're somewhere random on your D:\ drive, and you want to go to the root of your drive, you can use this command :

    cd d:\
    

    If you're somewhere random on your D:\ drive, and you want to go to a specific folder on your drive, you can use this command :

    cd d:\Docs\Java
    

    If you're on a different drive, and you want to go to the root of your D:\ drive, you can use this command :

    cd /d d:\
    

    If you're on a different drive, and you want to go to a specific folder on your D: drive, you can use this command :

    cd /d d:\Docs\Java
    

    If you're on a different drive, and you want to go to the last open folder of you D: drive, you can use this command :

    cd /d d:
    

    As a shorthand for cd /d d:, you can also use this command :

    d:
    
    0 讨论(0)
  • 2020-12-04 05:06

    In order to move to D drive in windows use, C:\Users\Balaji>d:

    In order to move to E drive use, C:\Users\Balaji>e:

    same will be applicable for other drives.

    0 讨论(0)
提交回复
热议问题