how to change directory using Windows command line

后端 未结 4 1465
北恋
北恋 2020-12-12 09:54

I\'m using cmd.exe (C:\\WINDOWS\\System32\\cmd.exe) and I have to change my current directory to \"D:\\temp\" i.e. temp folder in the D drive.

When I tr

相关标签:
4条回答
  • 2020-12-12 10:01

    cd has a parameter /d, which will change drive and path with one command:

    cd /d d:\temp
    

    ( see cd /?)

    0 讨论(0)
  • 2020-12-12 10:15

    Another alternative is pushd, which will automatically switch drives as needed. It also allows you to return to the previous directory via popd:

    C:\Temp>pushd D:\some\folder
    D:\some\folder>popd
    C:\Temp>_
    0 讨论(0)
  • 2020-12-12 10:19

    The "cd" command changes the directory, but not what drive you are working with. So when you go "cd d:\temp", you are changing the D drive's directory to temp, but staying in the C drive.

    Execute these two commands:

    D:
    cd temp
    

    That will get you the results you want.

    0 讨论(0)
  • 2020-12-12 10:22

    Just type your desired drive initial in the command line and press enter

    Like if you want to go L:\\ drive, Just type L: or l:

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