环境:Windows10
首先以管理员身份运行cmd
输入diskpart
Microsoft Windows [Version 10.0.17763.678]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\windows\system32>diskpart
Microsoft DiskPart version 10.0.17763.1
Copyright (C) Microsoft Corporation.
On computer: CFL0494W
DISKPART>
在DISKPART>提示符后面输入“list volume”,显示出所有的卷标
DISKPART> list volume
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 BDEDrive NTFS Partition 500 MB Healthy System
Volume 1 C OSDISK NTFS Partition 232 GB Healthy Boot
Volume 2 D DATA NTFS Partition 232 GB Healthy
Volume 3 Win10NVMe NTFS Partition 30 GB Healthy
Volume 4 Partition 161 GB Healthy Offline
DISKPART>
记住你要操作的volume号。比如我这里要操作的是volume 4
现在可以关闭这个命令窗口了。
打开记事本,写下如下内容并保存为mount.txt(注意volume号要和你的目标对应,不要照抄volume 4):
select volume 4
assign letter=e
再打开记事本,编写一个bat文件,命名为mount.bat
diskpart /s %1
pause
鼠标右键点击这个mount.bat,选择“发送到”-->“桌面快捷方式”
在桌面的mount.bat的快捷方式上点右键,选择属性
在“目标”里面,后面添加上你的mount.txt的路径
然后点击这个对话框下面3个按钮最后一个“高级”按钮(我这里是Advanced)
弹出的对话框里,将“以管理员身份运行”打勾
这样就可以双击这个快捷方式自动装载一个分区卷了。
再新建一个文本文件"unmount.txt",里面写下面的内容(注意volume号要和你的目标对应,不要照抄volume 4):
select volume 4
remove all dismount
同样的方式创建另一个桌面快捷方式,并在快捷方式的“属性”,“目标”中增加unmount.txt的路径,“高级”勾选“管理员身份运行”