Mounting a folder as a drive and giving it a label can be a useful way to organize and access your files on Windows. This article will guide you through the process of mounting a folder as a drive and assigning it a label using the command line.
Step 1: Open Command Prompt
To begin, we need to open the Command Prompt. Press the Windows key + R on your keyboard to open the Run dialog box. Type "cmd" and press Enter or click OK to open the Command Prompt.
Step 2: Create a New Directory
Next, we need to create a new directory where we will mount our folder as a drive. In the Command Prompt, type the following command:
mkdir C:\NewDrive
This will create a new directory named "NewDrive" in the C drive. You can choose a different name or location for your directory if you prefer.
Step 3: Mount the Folder as a Drive
Now, we can mount our desired folder as a drive using the "subst" command. In the Command Prompt, type the following command:
subst Z: C:\NewDrive
This command will assign the drive letter "Z:" to the "NewDrive" directory we created in the previous step. You can replace "Z:" with any available drive letter you prefer.
Step 4: Assign a Label to the Drive
By default, the drive will be labeled with the name of the folder. However, you can assign a custom label to the drive using the "label" command. In the Command Prompt, type the following command:
label Z: MyCustomLabel
This command will set the label of the drive to "MyCustomLabel". Replace "Z:" with the drive letter you assigned in the previous step, and "MyCustomLabel" with the desired label for your drive.
Step 5: Accessing the Mounted Drive
Now that you have successfully mounted the folder as a drive and assigned it a label, you can access it through File Explorer or any other file management tool. Simply open File Explorer and you will see the newly created drive listed under "This PC" or "Computer".
Step 6: Removing the Mounted Drive
If you no longer need the mounted drive, you can remove it using the "subst" command. In the Command Prompt, type the following command:
subst Z: /d
This command will remove the drive letter "Z:" from the system. Replace "Z:" with the drive letter you assigned to your mounted drive.
That's it! You have now learned how to mount a folder as a drive and give it a label using the command line in Windows. This can be a handy way to organize and access your files more efficiently.
References
| Source | Link |
|---|---|
| Microsoft Docs | https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst |