flo*_*hge 11 windows thinkpad external-hard-drive windows-8
有没有办法在 Windows 8.1 中通过脚本或简单的实用程序软件挂载和卸载连接的硬盘?
基本上,我的 ThinkPad 的 ultrabay 插槽中有一个硬盘驱动器(而不是 DVD 驱动器)。启动系统时,这个硬盘驱动器会自动安装并且对我可见。使用任务栏中的图标我可以卸载它。不幸的是,只有当我重新启动系统时它才再次可用。
所以我想问一下是否有任何命令行脚本可以执行以卸载驱动器并使用另一个脚本重新安装它而无需重新启动?
这样我就可以在启动后调用 unmount-script,所以驱动器并不总是在运行,只有当我需要它的一些东西时,我才调用 mount-script 然后可以访问文件。
如果有人对如何解决这个问题有任何想法,那就太好了!谢谢!
joe*_*eey 11
免责声明:您对自己的行为负责。我我不负责的任何损害,你可能会因尝试下面列出什么导致您的计算机或笔记本电脑。
在做了一些研究后,我发现了这个Instructable,详细介绍了如何使用 Windows 命令安装和卸载驱动器MOUNTVOL。
首先,以管理员身份打开命令提示符。
运行命令mountvol并记下要挂载/卸载的驱动器盘符上方的卷名(例如\\?\Volume{########-####-####-####-############}\)
要卸载驱动器,请键入mountvol [DriveLetter] /p。请务必[DriveLetter]使用分配给要卸载的驱动器的字母替换。(例如,G:)
要安装驱动器,请键入mountvol [DriveLetter] [VolumeName]。确保替换[DriveLetter]为您希望将驱动器安装到的字母(例如,G:),以及[VolumeName]您在步骤 2 中记下的卷名。
这是两个简单的批处理脚本的示例,您可以使用它来装载和卸载您选择的驱动器。
为了使批处理文件工作,您需要以管理权限运行它们,否则批处理文件将返回Access Denied错误。
卸载:
@echo off
REM Be sure to change this to the drive you want to unmount!
set drive=G:
echo Unmounting Drive...
mountvol %drive% /p
echo Drive Unmounted!
pause
exit
Run Code Online (Sandbox Code Playgroud)
安装:
@echo off
REM Be sure to change this to the drive letter you want to mount the drive to!
set drive=G
REM Be sure to change this to the Volume Name of the drive you want to mount!
set volume=\\?\Volume{ae101d9f-7653-11e3-be83-8056f23387a6}\
:start
echo Mounting Drive...
mountvol %drive%: %volume%
echo Drive Mounted!
pause
exit
Run Code Online (Sandbox Code Playgroud)
确保在运行之前更改顶部的批处理文件,以确保安装/卸载正确的驱动器。
不要使用/D,它只会删除驱动器号分配。使用/p. 来自mountvol /?:
/p Removes the volume mount point from the specified directory,
dismounts the volume, and makes the volume not mountable.
You can make the volume mountable again by creating a volume
mount point.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
182663 次 |
| 最近记录: |