Одной из особенностей Windows 10 является возможность создания виртуального диска из папки. Это добавляет новый жесткий диск в папку «Этот компьютер». При открытии диска в Проводнике будет показано содержимое исходной папки.
Создать диск из папки можно сделать с помощью встроенной команды subst. Она связывает путь с буквой диска. При использовании команды без параметров subst отображает буквы виртуальных дисков, которые вы уже создали с помощью инструмента.
Инструмент subst не является эксклюзивной функцией Windows 10. Он был впервые представлен в DOS и включен в каждую версию Windows. Диски, созданные с использованием subst, остаются доступными во время сеанса пользователя или до тех пор, пока вы не отключите виртуальный диск вручную. Перезапуск, выключение компьютера или выход из учетной записи пользователя приведет к полному отключению виртуальных дисков, и вам потребуется заново создать их, чтобы использовать их снова.
Чтобы создать виртуальный диск из папки в Windows 10,
Шаг 1: Откройте новый экземпляр командной строки или PowerShell от имени Администратора.
Шаг 2: Введите следующую команду: subst <диск:> path\путь\к папке
Шаг 3: Замените часть <диск:> буквой, которую вы хотите назначить виртуальному диску. Буква не должна использоваться никаким реальным или виртуальным диском, включая съемные устройства, подключенные к вашему ПК.
Шаг 4: Замените путь к папке \путь\к папке полным путем к исходной папке, которую вы хотите смонтировать как диск, я использую папку Files которая находится на диске D.
Шаг 5: Теперь откройте проводник и откройте папку «Этот компьютер». Вы увидите новый диск там.
С помощью subst вы можете быстро найти виртуальные диски, доступные в текущем сеансе пользователя.
Найти виртуальные диски, созданные с помощью Subst.
Шаг 1: Откройте новую командную строку.
Шаг 2: Введите subst без параметров и нажмите клавишу Enter.
В выводе вы увидите список виртуальных дисков, созданных с помощью subst.
Все!
Как удалить диск, созданный с помощью subst.
Шаг 1: Откройте новую командную строку.
Шаг 2: Введите следующую команду: subst <диск:> /D
Замените часть <диск:> фактической буквой виртуального диска, который вы хотите удалить.
Шаг 3: Нажмите клавишу Enter. Диск удален.
Совет: Windows 10 можно подключить к виртуальному диску каждый раз, когда вы входите в свою учетную запись. Это может быть полезно, если у вас есть программное обеспечение, которое ищет файлы в некоем жестком месте, которое недоступно на вашем ПК. Вот как.
Создание виртуального диска с Subst при запуске Windows 10
Шаг 1: Создайте новый .BAT файл со следующим содержимым: @subst F: d:\Data\Files
Шаг 2: Исправьте букву диска и путь к папке в соответствии с вашими требованиями.
Шаг 3: Нажмите Win + R, чтобы открыть диалоговое окно «Выполнить».
Шаг 4: Введите следующие командe: shell:Startup
Шаг 5: Это откроет папку автозагрузки. Переместите созданный пакетный файл туда.
Каждый раз, когда вы входите в Windows 10, Будет создан виртуальный диск из указанной папки и назначена ему соответствующая буква диска.
Как добавить команду «Создать диск из папки» в контекстное меню Проводника
Шаг 1: Откройте текстовый редактор «Блокнот»
Шаг 2: Скопируйте и вставьте в него следующие строки:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Mount R\command]
@=»subst r: \»%1\»»
Шаг 3: Сохраните его с расширением *.reg
Шаг 4: Запустите созданный файл выполнив слияние, подтвердите запрос системы на внесение изменений в реестр. Все, Теперь откройте проводник кликните правой кнопкой мыши на папку из которой будет создан виртуальный диск и выберите в контекстном меню «Mount R».
Перейдите в «Этот компьютер» Здесь вы найдете созданный диск. Все!
Windows 11 and 10 allow you to mount a drive or partition in a folder. Also, you can mount your favorite folder as Drive in Windows 11 or 10 to quickly access that in File Explorer.
Once you mount your folder as a virtual drive, the folder will appear and act like other drives or partitions such as “C,” “D” drive, etc., in the root of the File Explorer.
Windows 11 and 10 let you mount a folder as a physical drive using the built-in subst command. It associates a path with a drive letter. If you use the subst command without parameters, it displays the names of the existing virtual drives you have already created.
The drives you create using the subst command remain available during your user session or until you unmount them manually. Restarting, shutting down the PC, or signing out from your user account will unmount virtual drives, and you will need to re-create them to use them again. So, to quickly mount a virtual drive, you can create a desktop shortcut.
How to Mount Folder as a Drive in Windows 11 or 10?
To mount the folder as a drive in Windows 11 or 10, use these steps:-
Step 1. Right-click on the free space on the desktop and select the New > Shortcut option.
Step 2. In the “Create Shortcut” wizard, type subst X: “C:\complete_path_of_folder” in the blank field.
Note: Replace the “X:” with an unassigned drive letter (that is not visible in the File Explorer) you want to assign and “C:\complete_path_of_folder” with the complete path of the folder you want to mount as a drive. For example, we will assign the drive letter “Z:” to the “G:\GUW” folder.
Step 3. After filling in the text field, click the Next button.
Step 4. In the following window, name the shortcut and click the Finish button.
Once you complete the above steps, a new shortcut icon will appear on the desktop. You can mount your folder as a virtual drive by double-clicking this shortcut icon. The changes made in the virtual drive will appear in your folder. If you delete or create a file or folder in the virtual drive, the same will appear in your actual folder.
How to Create and Mount Virtual Drive on Startup in Windows 11 or 10?
If you want to create and mount the virtual drive with the Startup of Windows 11 or 10, use these steps:-
Step 1. Open a Notepad file.
Step 2. Copy and paste the following into the notepad:-
@subst X: “C:\complete_path_of_folder”
Note: Replace the “X:” with an unassigned drive letter (that is not visible in the File Explorer) you want to assign and “C:\complete_path_of_folder” with the complete path of the folder you want to mount as a drive. For example, we will assign the drive letter “Z:” to the “G:\GUW” folder.
Step 3. Click on the File menu and select the Save as option.
Step 4. When you’re done, the File Explorer window will open. In File Explorer, choose the desired location where you want to save the file. Name the file with the “.bat” extension. Select the All files option in the “Save as type” drop-down menu. Finally, click the Save button.
Once you complete the above steps, you will find a batch file in your chosen location.
Step 5. Now, open the Run dialog box using Windows + R hotkey.
Step 6. Type, shell:startup in the Run box and click the OK button.
Step 7. Once done, the Startup folder will open. Copy and paste the newly created batch file here.
Once you complete the above steps, your chosen folder will automatically be mounted as a virtual drive and appear in File Explorer each time you restart your computer.
If you don’t want to mount your folder as a virtual drive, delete the batch file from the Startup folder.
Conclusion
In conclusion, Windows 11 and 10 offer a convenient way to mount a folder as a virtual drive using the built-in subst command. This allows the folder to appear and act like other drives or partitions, making it easy to access frequently used folders. By creating a desktop shortcut or a batch file in the Startup folder, users can quickly mount their favorite folders as virtual drives and have them automatically available each time they start their computer. With these simple steps, Windows 11 and 10 provide an efficient and customizable way to manage your files and folders.
How to Create Virtual Drive From A Folder in Windows 10
A lesser known feature of Windows 10 is the ability to create a virtual drive from a folder. This will add a new hard drive to the This PC folder, with a dedicated drive letter. Opening the drive in File Explorer will display the contents of the source folder located in the root folder of the drive.
This can be done with help of the built-in subst command. It associates a path with a drive letter. If used without parameters, subst displays the names of the eixsting virtual drives you have already created with the tool.
The subst tool is not an exclusive feature of Windows 10. It was first introduced in DOS, and is included in every Windows version.
Drives that were created using subst remain available during your user session, or until you unmount a virtual drive manually. Restarting, shutting down the PC or signing out from your user account will destroy virtual drives, and you will need to re-create them to use them again.
- Open a new command prompt instance.
- Type the following command:
subst <drive:> path\to\folder
. - Replace the <drive:> portion with the actual drive letter you want to assign to the virtual drive. The letter shouldn’t be used by any real or virtual drive, inlcuding removable devices currently plugged in.
- Substitute the path\to\folder portion with the full path to the source folder you want to mount as a drive.
- Hit the Enter key. The drive is created.
Now, open File Explorer and check out the This PC folder. You will see a new drive there.
With subst, you can quickly find virtual drives you have available in the current user session.
Find Virtual Drives Created with Subst
- Open a new command prompt.
- Type
subst
without parameters and hit the Enter key. - In the output, you will see the list of virtual drives created with
subst
.
You are done.
Finally, let’s see how to remove a drive created with subst.
Remove Virtual Drive Created with Subst
- Open a new command prompt.
- Type the following command:
subst <drive:> /D
. - Replace the
<drive:>
portion with the actual letter for the virtual drive you want to remove. - Hit the Enter key. The drive is now removed.
You are done.
Tip: You can make Windows 10 mount a folder to a virtual drive every time you sign in to your user account. This can be useful if you have a software that looks for files under some hardcoded location, that is not available on your PC. Here’s how.
Create a Virtual Drive with Subst On Startup in Windows 10
- Create a new batch file with the following contents:
@subst W: c:\Data\drive_w
Correct the drive letter and the folder path to match your requirements. - Press Win + R to open the Run dialog.
- Type the following shell command:
shell:Startup
. - This will open the Startup folder. Move your batch file there.
You are done! Every time you sign in Windows 10 will create a virtual drive from the specified folder and assign it the appropriate drive letter.
That’s it.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won’t take a lot from you, but it will help us grow. Thanks for your support!
Download Windows Speedup Tool to fix errors and make PC run faster
If you want to map a local folder as drive with letter in Windows 11, here is how you can do that. It is possible to do such things with the help of the Command Prompt and predefined command. This article explains the exact method along with the required command so that you can map any local folder with drive letter in Windows 11 as well as Windows 10.
To map local folder as drive with letter in Windows 11, follow these steps:
- Create a folder you want to map.
- Right-click on it and select the Copy as path option.
- Right-click on the Start Menu.
- Select Windows Terminal (Admin) option.
- Click on the Yes button in the UAC prompt.
- Enter this command: subst drive-letter: folder-path
To learn more about these steps, continue reading.
First, you need to create a folder or select a folder you want to map as drive with letter on your computer. You can create the folder anywhere, including C or the system drive.
Then, you need to copy the path of the folder. Generally, you can find the path from the Properties panel. However, Windows 11 allows users to do the same from the right-click context menu. Therefore, right-click on the desired folder and select the Copy as path option.
Then, right-click on the Start Menu and select the Windows Terminal (Admin) option. Following that, click on the Yes button in the UAC prompt to open Windows Terminal with administrator privilege.
Once done, enter this command in the Command Prompt instance:
subst drive-letter: folder-path
Let’s assume that you have a folder named TWCdemo on your Desktop. On the other hand, you need to replace the drive-letter with the desired and available drive letter. In other words, your command will look like this:
subst H: C:\Users\Sudip\Desktop\TWCdemo
You can check the assigned drive letter by entering the subst command in the Command Prompt.
On the other hand, if you want to remove the mapping, you can enter this command:
subst H: /D
Here, H is the drive letter you set earlier.
Read: How to map or add a Network Location or Map FTP Drive in Windows
How do I map a drive to a specific letter?
To map a drive to a specific letter, you need to use the Disk Management panel. This utility helps you change the drive letter in Windows 11/10 PC without any third-party app. On the other hand, you can use the DISKPART command to get the same thing done. Both options do the same thing.
Read: How to mount a Drive as Folder rather than Letter in Windows 11
Can I assign a drive letter to a folder?
Although the Disk Management panel doesn’t have the option to assign a drive letter to a folder, you can use the Command Prompt to get it done. You can make use of the subst command to assign any drive letter to a folder. It is recommended to go through the aforementioned steps to get a detailed overview.
That’s it! Hope it helped.
Read: How to map OneDrive as Network Drive in Windows.
When he is not writing about Microsoft Windows or Office, Sudip likes to work with Photoshop. He has managed the front end and back end of many websites over the years. He is currently pursuing his Bachelor’s degree.
Reader Interactions
В Windows 11 и 10 существует возможность подключения диска в виде пути на другом диске. То есть вместо назначения букв каждому диску или разделу диска вы при желании можете сделать так, чтобы все они отображались в рамках одного диска.
В этой инструкции — о том, как подключить диск в виде папки в другом расположении в Параметрах, Управлении дисками или с помощью командной строки.
Параметры
Описываемая возможность доступна в приложении «Параметры». Для подключения диска в виде папки с их помощью достаточно выполнить следующие шаги:
- Откройте Параметры — Система — Память — Дополнительные параметры хранилища — Диски и тома.
- Нажмите «Свойства» справа от диска, который нужно подключить.
- В разделе «Пути» нажмите «Добавить».
- Укажите путь к любой (обязательно пустой) папке на диске, в рамках которого нужно отображать содержимое выбранного диска и нажмите «Ок».
Готово, теперь при открытии соответствующей папки или при обращении к ней каким-либо образом вы будете получать доступ к содержимому выбранного диска.
При необходимости вы можете удалить букву диска, который вы подключили в виде папки: прямо в этом же окне «Параметров», нажав по кнопке «Сменить букву диска» и выбрав «Нет», либо другими способами: в командной строке или утилите «Управление дисками».
Управление дисками
То же самое можно выполнить в «Управление дисками»:
- Откройте «Управление дисками» через контекстное меню кнопки «Пуск», нажав по ней правой кнопкой мыши и выбрав нужный пункт меню, либо с помощью команды Win+R — diskmgmt.msc
- Нажмите правой кнопкой мыши по диску, который нужно подключить как папку на другом диске и выберите пункт «Изменить букву диска или путь к диску».
- Нажмите кнопку «Добавить».
- Выберите пункт «Подключить том как пустую NTFS-папку», нажмите «Обзор» и укажите путь к пустой папке на нужном диске, нажмите «Ок».
Готов, диск будет подключен как папка на другом диске. Как и в предыдущем случае вы можете удалить букву с диска, если не хотите, чтобы он отображался в виде отдельного диска в «Проводнике».
Командная строка
И ещё один метод — командная строка и утилита DISKPART. Порядок действий:
- Запустите командную строку от имени администратора.
- По порядку введите следующие команды, заменив N на номер нужного раздела (который мы подключаем), а C:\Folder на путь к нужной папке:
diskpart list volume select volume N assign mount=C:\Folder exit
Готово, диск будет подключен как папка.
Если в будущем вам потребуется отключить диск, подключенный в виде папки, используйте те же команды, но предпоследнюю замените на remove mount=C:\Folder
Удаление подключения в виде папки ни в командной строке ни другими способами: в «Параметрах» или «Управлении дисками» не приведёт к удалению данных с диска: если нужно, вы сможете назначить ему букву или подключить к другой папке и пользоваться как обычно.