How To Change To Another Drive On The Command Line

Table of contents:

How To Change To Another Drive On The Command Line
How To Change To Another Drive On The Command Line

Video: How To Change To Another Drive On The Command Line

Video: How To Change To Another Drive On The Command Line
Video: Command Prompt Change Directories/Folders To Another Drive 2024, December
Anonim

The standard Windows distribution kit, even in the latest versions, contains tools for working in manual DOS command input mode. Using the DOS emulator, you can directly access the application and system programs installed on the computer, bypassing the intermediate links of the Windows graphical interface. One of the most common command line operations is changing the disk.

How to change to another drive on the command line
How to change to another drive on the command line

Instructions

Step 1

Use the cd command to change to a different operating system drive. CD is shorthand for chdir (from CHange DIRectory - "Change Directory"). DOS syntax allows for both cd and chdir. A full description of this command can be obtained directly in the terminal by executing it with the modifier / ?:

chdir /?

Step 2

Add the / d modifier to the chdir (or cd) command to switch from live media to another physical or virtual disk. For example, if you need to go to drive F, then type and execute the following command:

chdir / d F:

Step 3

Use a backslash () as a parameter to the chdir command to change from any directory on the current drive to its root:

chdir \

Step 4

In addition to the / d modifier, specify the full path from the root of the required disk if you need to switch to a specific directory located on it. For example, to go to a folder named SubFilder located on the F drive inside the MainFolder directory, you must enter and execute in the command line:

chdir / d F: / MainFolder / SubFilder

Step 5

Entering long paths to folders over and over again is rather inconvenient. The command line terminal interface does not allow you to select and copy a path typed once, but there is a command to paste the copied one in it. Can be used as an auxiliary tool, for example, Windows Explorer. Having opened the necessary folder in it, select and copy the full path in the address bar (CTRL + C). Then switch to the command line terminal, right-click it and select "Paste" from the context menu.

Step 6

Enclose the full path to the desired folder in quotation marks if it contains spaces in the directory names. For example, like this:

chdir / d "F: / Program Files / msn gaming zone"

Quotation marks are not always needed - only if the so-called "shell extensions" are activated in the operating system.

Step 7

Disable shell extensions if you want to enter full paths without quotes when switching to another drive:

cmd e: off

Recommended: