Cmd change disk windows

Command prompt won’t change directory to another drive

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

It doesn’t change the directory. I try again using quotes:

Again it doesn’t change the directory. What am I doing wrong?

11 Answers 11

As @nasreddine answered or you can use /d

For more help on the cd command use:

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

cd «\winnt\profiles\username\programs\start menu»

which is what you would have to type if extensions were disabled.

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

then you can cd into the directory you want.

Use drive letter d for changing to D drive like:

When changing drives, you just need to type the drive letter, like d: (don’t use the backslash, like d:\; it doesn’t work).

You only use cd when moving between directories within the same drive.

The short answer

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

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 :

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 :

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

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 :

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 :

you should use a /d before path as below :

If you want to change from current working directory to another directory then in the command prompt you need to type the name of the drive you need to change to, followed by : symbol. example: assume that you want to change to D-drive and you are in C-drive currently, then type D: and hit Enter.

On the other hand if you wish to change directory within same working directory then use cd(change directory) command followed by directory name. example: assuming you wish to change to new folder then type: cd «new folder» and hit enter.

Tips to use CMD: Windows command line are not case sensitive. When working with a file or directory with a space, surround it in quotes. For example, My Documents would be «My Documents». When a file or directory is deleted in the command line, it is not moved into the Recycle bin. If you need help with any of command type /? after the command. For example, dir /? would give the options available for the dir command.

Читайте также:  Lenovo easycamera windows 10 не работает

Источник

Command Prompt: 11 basic commands you should know (cd, dir, mkdir, etc.)

Geeks and experts love the Command Prompt because of the advanced commands it can run. Fortunately, Command Prompt is not built only on advanced commands, but also on simple ones, designed to perform basic operations. In this article, we show you how to execute commands such as changing the current directory, switching to another drive, viewing the contents of a directory, creating and renaming folders, copying, deleting files and folders, and launching applications from the Command Prompt. We are also going to show you how to get help when using this app for Windows. Let’s get started:

NOTE: The information shared in this tutorial applies to Windows 10, Windows 8.1, and Windows 7. Note that, for simplicity, we are using screenshots taken only in Windows 10.

1. How to change the directory (folder) in Command Prompt (CMD)

The first command from the list is CD (Change Directory). This command enables you to change the current directory or, in other words, to navigate to another folder from your PC. For instance, the command CD takes you to the top of the directory tree. To see how it works, after you open the Command Prompt, type cd and press Enter on your keyboard. You should see how the CD command takes you to the top of the directory tree. In this case, to the “C:” drive.

Note that the Command Prompt is not case sensitive, meaning that you can type commands using capital letters, lowercase or any combination of them. The commands CD, cd or Cd, all work the same way.

Going back to the “CD” command, now you are working on the root of the “C:” drive. If you need to go to a specific folder from this drive run the command “CD Folder.” The subfolders must be separated by a backslash character: “.” For instance, when you need to access the System32 folder located in “C:\Windows,” type “cd windows\system32” as shown below, and then press Enter on your keyboard.

When you need to go one folder up, use the “cd..” command. Let’s assume that you want to go back to the Windows folder. Type “cd..” and press Enter on your keyboard.

The effect is that your current directory changes to “C:\Windows.”

2. How to change the drive in Command Prompt (CMD)

To access another drive, type the drive’s letter, followed by “:”. For instance, if you wanted to change the drive from “C:” to “D:”, you should type “d:” and then press Enter on your keyboard.

To change the drive and the directory at the same time, use the cd command, followed by the “/d” switch. The “/d” parameter is used to change the current drive to a specific folder from another disk volume.

For instance, if you are now on the “D:” drive and you want to go back to the Windows folder from the”C:” drive, you should type “cd /d C:\Windows” and press Enter on your keyboard, like in the following screenshot.

NOTE: By typing only the drive letter you automatically move to your most recent location on that drive. For instance, if you are on “D:” drive and type “cd c:\windows” nothing seems to happen. However, if you type “c:” then the working folder changes to “c:\windows,” assuming that it was the last folder you worked with on your “C:” drive.

3. How to view the contents of a directory in Command Prompt (CMD)

You can view the contents of a folder by using a command called DIR. To test it, we have created a folder named Digital_Citizen on the D: drive, with several files and subfolders. You can see them in the screenshot below.

The last time, our working folder was “C:\Windows.” To navigate to the folder mentioned above, we have to use the command “cd /d D:\Digital_Citizen.” To view the contents of the folder, type DIR, and press Enter. The list of the files and folders contained by it is displayed, together with some details about each of them (the size and the date and time when they were last modified).

4. How to create a new directory with Command Prompt (CMD)

You can make a new folder using the MKDIR (Make Directory) or the MD command. The syntax of these commands is “MKDIR Folder” or “MD Folder.”

Let’s say we need to create a new folder called Digital_Citizen_Life that is going to be placed in the “D:\Digital_Citizen” folder. To do that, we need to type “mkdir Digital_Citizen_Life” and then press Enter, as shown below.

To test if it worked, use the DIR command again. The newly created folder appears in the list.

Читайте также:  Windows амалды жйесіні е маызды ерекшелігі

NOTE: Do not forget that all these commands depend on the current location in the Command Prompt. For instance, if you are on the “C:” drive and type “MKDIR test,” the new folder is created in the root of the “C:” drive.

Another way to create a folder that does not involve being in the desired folder is to type the complete path of the new folder. For example, if you are working on the “D:” drive and you want to create a new folder in “C:,” called other_stuff, type “mkdir c:\other_stuff” and then press Enter.

When you need to create a folder with subfolders at the same time, you can use the “MKDIR FolderSubfolder” command. For instance, if we type “mkdir Digital_Citizen_Tests\Beta\Test1” three folders are created: Digital_Citizen_Tests, Beta and Test1, in a tree-like structure.

5. How to rename files and folders with Command Prompt (CMD)

To rename files and folders, you need to use the REN (Rename) command. To rename folders, type “ren Folder NewFolderName.” For example, if we wanted to rename the Digital_Citizen_Tests folder to Digital_Citizen_Final_Tests, we should run “ren Digital_Citizen_Tests Digital_Citizen_Final_Tests” and press Enter.

To rename a file, use the same command, like this: “ren filename.extension newname.extension”. For instance, to rename the Digital_Citizen_Picture1.bmp file to Image0.bmp, we have to run the command “ren Digital_Citizen_Image1.bmp Image0.bmp” command.

Read the second page of this tutorial if you want to learn how to copy files and folders, delete files and folders, start an application, and get help when using the Command Prompt.

Источник

Переход на другой диск cmd (Windows 7)

Как перейти на другой диск в командной строке (cmd).

Делаю так, но не работает (пробовал вводить во всех регистрах в разных комбинациях)

4 ответа 4

Для случая если требуется просто перейти в корень другого диска, просто укажите имя диска без команды cd

Можно сразу сменить диск и перейти в папки (см. ответ Bald)

Для перехода на другой диск в командной строке Windows просто укажите его имя с двоеточием. Например, чтобы перейти на диск D, нужно ввести

Команда cd имеет одну особенность. Если в ней указать не тот диск, который сейчас активен, то перехода в нужный каталог не произойдёт. Вы останетесь на активном диске, не перейдя на другой. Чтобы не только сменить текущий каталог на другом диске, но и перейти на него, нужно добавить ключ /d :

Вывод имени либо смена текущего каталога.

CHDIR [/D] [диск:][путь] CHDIR [..] CD [/D] [диск:][путь] CD [..]

.. обозначает переход в родительский каталог.

Команда CD диск: отображает имя текущего каталога указанного диска. Команда CD без параметров отображает имена текущих диска и каталога.

Параметр /D используется для одновременной смены текущих диска и каталога.

Изменение команды CHDIR при включении расширенной обработки команд:

Имя текущего каталога в строке вызова преобразуется к тому же регистру символов, что и для существующих имен на диске. Так, команда CD C:\TEMP на самом деле сделает текущим каталог C:\Temp, если он существует на диске.

Команда CHDIR перестает рассматривать пробелы как разделители, что позволяет перейти в подкаталог, имя которого содержит пробелы, не заключая все имя каталога в кавычки. Например:

приводит к тому же результату, что и:

При отключении расширенной обработки команд используется только второй вариант.

Если нужно запустить DOS окно («Командная строка») тогда нажмите Windows + r и в окне введите и выполните команду

Если DOS окно уже открыто, то введите

это диск который вам нужен

путь к нужной папке

command1 & command2 Используйте для разделения нескольких команд в одной командной строке. Cmd.exe запускает первую команду, а затем вторую команду.

command1 && command2 Используйте для запуска команды, следующей за && только если команда, предшествующая символу, успешна. Cmd.exe запускает первую команду, а затем запускает вторую команду только в том случае, если первая команда успешно завершена.

command1 || command2 Используйте для запуска команды, следующей за || только если команда, предшествующая || выходит из строя. Cmd.exe запускает первую команду, а затем запускает вторую команду только в том случае, если первая команда не завершилась успешно (получает код ошибки больше нуля).

(command1 & command2) Использовать для группировки или размещения нескольких команд.

command1 parameter1;parameter2 Используйте для разделения параметров команды.

Источник

How to Change Directory in CMD | How to Use CD Command Win 10 [MiniTool News]

By Alisa | Follow | Last Updated March 04, 2021

Summary :

This tutorial gives a detailed guide on how to change directory in CMD (Command Prompt) in Windows 10 computer. Learn how to use CD command in Windows Command Prompt to access different directories and folders. FYI, MiniTool software designs a free data recovery software program allowing you to recover any deleted/lost files from Windows 10/8/7 computer and other storage devices.

Windows Command Prompt (cmd.exe) lets you do many things quickly on your Windows computer. Wonder how to change directory in CMD? You can use the CD command to easily do this.

Читайте также:  8007007e windows 10 принтер

What Is CD Command in Windows?

The CD command refers to “change directory”. It is a professional Windows Command Prompt change directory command. You can use CD command to easily change the current working directory in CMD in Windows 10, and open different directories or folders on your Windows 10 computer. Check how to use CD command to change directory in Command Prompt below.

How to Change Directory in CMD Windows 10

How to Change Directory in CMD with CD Command

Step 1. Open Windows Command Prompt Utility

Before you use Command Prompt to change directory, you should enter into Command Prompt at first.

You can press Windows + R, type cmd, and press Ctrl + Shift + Enter to open elevated Command Prompt in Windows 10.

Step 2. How to Use CD Command in CMD to Change Directory

Then you can type CD command lines in CMD to change different directory or folder paths.

If you want to go to a specific directory, you can type cd + full directory path, e.g. cd C:\Program Files.

To open a particular folder, you can type cd + full folder path, e.g., cd C:\Program Files\office.

To check the whole subdirectories and folders in the current directory, you can type dir command.

To go to the root level directory from any directory, you can type cd \.

To change the current drive, you can firstly type cd \ to go to the root directory, and then enter the drive letter followed by a colon to enter the target drive, e.g. I:.

To change the drive and directory at the same time, you can use CD and the /D switch simultaneously, e.g., cd /D I:\MiniTool Partition Wizard 11.

Bottom Line

Now you should know how to change directory in Command Prompt (CMD) by using CD command in Windows 10. You can easily access different directories or folders with CD command Windows in Command Prompt.

If you can’t find a file or folder in your Windows 10 computer, you may lost it or mistakenly deleted it, you can easily recover the file or folder with MiniTool Power Data Recovery.

MiniTool Power Data Recovery is a professional free data recovery program compatible with Windows 10/8/7. You can use this software to easily recover data from various data loss situations.

Namely, you can recover any deleted/lost files from Windows 10/8/7 computer, external hard drive, USB/thumb/pen drive, SD card, and more.

For the data loss due to mistaken file deletion, system crash and other computer system issues, hard drive failure, malware/virus infection, etc. you can use MiniTool Power Data Recovery to easily retrieve the lost files and data.

ABOUT THE AUTHOR

Position: Columnist

Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.

Источник

Команда смены текущего каталога CD.

После запуска приглашение командной строки показывает текущий каталог. По умолчанию, это каталог профиля текущего пользователя. Для смены текущего каталога используется специальная команда CD.

Команда CD. Смена текущего каталога.

Для того чтобы перейти из текущего каталога в другой каталог используется команда cd. Команда имеет следующий синтаксис:CD [/D] [диск:][путь][..].
Команда для перехода в корневой каталог текущего диска выглядит так: cd\

Для того чтобы перейти в один из каталогов диска «C» используется команда: cd [каталог]
Например, зайдем в папку «Program Files»: cd program files

Для перехода из одного каталога диска «C» в другой каталог диска «C» используется команда: cd [\каталог]
Например, зайдем из папки «Program Files» в папку «Windows»: cd \windows

Для перехода из каталога в подкаталог используется команда: cd [каталог]
Например, зайдем из папки «Windows» в папку «Fonts», расположенную в папке «Windows»: cd fonts

Можно сразу перейти в папку «Fonts» из корневого каталога диска «C»: cd [каталог/подкаталог]
Например, перейдем в корень диска «C» с помощью команды cd\, а затем перейдем в папку «Fonts»:
cd windows/fonts

Чтобы перейти из текущего подкаталога в родительский каталог применяется команда cd..

Для перехода из текущего подкаталога в другой каталог, который не является родительским по отношению к текущему каталогу, применяется команда: cd [\каталог].
Например, перейдем в папку «Fonts» ( cd fonts ), а затем в папку «Program Files»: cd \program files

Теперь с диска «D» перейдем в папку «Fonts», расположенную в папке «Windows» на диске «C»:
cd /D c:/windows/fonts

Источник

Поделиться с друзьями
Советы экспертов и специалистов
Adblock
detector