我们都喜欢隐藏我们的个人数据,虽然您可以锁定文件夹并继续上传到在线存储,但隐藏整个分区怎么样?虽然它可能会让人觉得有点矫枉过正,但如果您有大量不希望任何人访问的文件,那么这是最好的方法。在这篇文章中,我们将展示如何使用命令提示符(Command Prompt)显示或隐藏驱动器分区。
(Unhide)使用命令提示符(Command Prompt)取消隐藏或隐藏硬盘分区(Hide Hard Drive Partition)
虽然有多种方法可以隐藏驱动器分区,但(hide drive partitions,)在这篇文章中,我们将专门分享如何通过命令提示符(Command Prompt)进行操作。我们正在使用Diskpart 工具(Diskpart tool),它还提供了一个命令行界面。在继续之前,请注意Diskpart是一个功能强大的工具,可提供完整的驱动器管理,它还包括删除分区的选项。虽然隐藏不会删除并且您可以随时将它们带回来,但请小心使用它。
基本 Diskpart 命令
- diskpart – 打开 Diskpart 控制台
- list volume – 显示计算机上的所有卷。
- select volume #number – 选择要隐藏的分区
- remove letter #driveletter –删除(Removes)所选卷的驱动器号
- assign letter #driveletter –将驱动器号分配(Assigns)给选定的卷
按照步骤隐藏或显示驱动器分区。
以管理员权限打开命令提示符。(Command Prompt)您可以通过在运行(Run)提示符 ( Win + RCMD来执行此操作,然后同时按Shift + Enter。你会得到UAC提示;确保从弹出窗口中选择是。
键入以下命令,然后按Enter键启动Diskpart控制台。
Diskpart
命令提示符(Command Prompt)中显示路径的文本将替换为“Diskpart>” 接下来,键入以下内容以列出您可以使用文件资源管理器(File Explorer)看到的所有分区。
list volume
打开文件资源管理器(Open File Explorer),转到这台电脑并将其与您在此处看到的内容匹配。在Diskpart工具结果中,Lable 列将与您在计算机上看到的确切名称匹配。由于限制,它可能会缩短名称,但会给你一个公平的想法。您还可以使用驱动器号识别磁盘。
要对特定驱动器进行任何操作,在这里我们将隐藏它,您需要选择驱动器或分区。假设我想隐藏标签为Backup的“D”分区。首先(First),我们必须选择卷,然后在驱动器上操作。备份分区的标签为 Volume 2。根据您的计算机执行以下操作以选择要隐藏的驱动器。
select volume 2
按照设计,如果一个分区没有分配驱动器号,它将无法访问。如果你还记得,当你格式化一个驱动器时,它总是在最后分配一个驱动器号。现在你知道原因了。执行命令删除驱动器号,在我的例子中是 D。
remove letter D
执行完成后,您应该会收到一条成功消息。仔细检查文件资源管理器(File Explorer),它不会在任何地方可用。从技术上讲,该分区已被卸载。
要恢复分区,您需要再次挂载它并再次分配驱动器号。您始终可以分配任何未分配给其他人的驱动器号。如果您在一段时间后这样做,请按照完整列表进行操作,否则只需最后一个就足够了。
list volume
select volume 2
assign letter J
要退出 diskpart 工具,请键入 exit,然后您将照常返回命令提示符。
我希望这篇文章能帮助您使用命令提示符隐藏驱动器分区。
阅读(Read): 为什么 C 总是默认的 Windows 系统驱动器号(Why is C the default Windows System Drive letter always)?
Unhide or Hide your Hard Drive Partition using Command Prompt
We all lovе tо hide our personal data, and while you can lock folder and keep uploading to online storage, how about hiding the сomplete partition? While it may feel overkіll, bυt if you have tons of files you don’t want anybody to access, then this is the best method to follow. In this post, we will show how you can show or hіde drive partitions using Command Prompt.
Unhide or Hide Hard Drive Partition using Command Prompt
While there are multiple ways to hide drive partitions, in this post, we are specifically sharing how to do it from the Command Prompt. We are using the Diskpart tool, which also offers a command-line interface. Before going ahead, stay warned that Diskpart is a powerful tool that offers complete management of drive, and it includes the option to delete the partitions as well. While hiding doesn’t delete and you can always bring them back, use it carefully.
Basic Diskpart Command
- diskpart – Opens Diskpart console
- list volume – Displays all the volumes on the computer.
- select volume #number – Selects the partition you want to hide
- remove letter #driveletter – Removes drive letter of the selected volume
- assign letter #driveletter – Assigns drive letter to the selected volume
Follow the steps to hide or show drive partition.
Open Command Prompt with admin permissions. You can do so by typing CMD in the Run prompt (Win + R), followed by pressing Shift + Enter together. You will get the UAC prompt; make sure to choose yes from the pop-up window.
Type the following command, and press the Enter key to launch the Diskpart console.
Diskpart
The text in the Command Prompt, which was displaying the path, will be replaced by “Diskpart>” Next, type the following to list all the partitions which you can see using File Explorer.
list volume
Open File Explorer, go to This PC and match it with what you see here. In the Diskpart tool result, the Lable column will match with the exact name you see on the computer. It might cut short the name because of the limit but gives you a fair idea. You can also identify the disk with the drive letter.
To do any operation on a particular drive, here we are going to hide it, you need to select the drive or partition. Let’s assume I want to hide the “D” partition with the label Backup. First, we will have to select the Volume and then operate on the drive. The backup partition has label Volume 2. Execute the following as per your computer to select the drive which you want to hide.
select volume 2
By design, if a partition doesn’t have a drive letter assigned, it will not be accessible. If you remember, when you format a drive, it is always assigned a drive letter at the end. Now you know the reason. Execute the command to remove the drive letter, which, in my case, is D.
remove letter D
Once the execution completes, you should receive a success message. Double-check with File Explorer, and it will not be available from anywhere. Technically, the partition has been dismounted.
To bring back the partition, you will need to mount it again and assign the drive letter again. You can always assign any drive letter which is not assigned to anyone else. If you are doing it after some time, then follow the complete list, else just the last one is enough.
list volume
select volume 2
assign letter J
To exit the diskpart tool, type exit, and you will get back to the command prompt as usual.
I hope the post helped you hide drive partitions using the command prompt.
Read: Why is C the default Windows System Drive letter always?