收到错误消息:参数不正确

收到错误消息:参数不正确

当我使用此批处理文件在 Windows 10 中安装和卸载驱动器时,我收到此错误消息。

安装:

@echo off

REM Be sure to change this to the drive letter you want to mount the drive to!
set drive=E

REM Be sure to change this to the Volume Name of the drive you want to mount!
set volume=\\?\Volume{52ade1a4-0fd4-44cd-aa69-bfda739bb9e6}\
set volume=\\?\Volume{4d654d26-f65d-4c67-b83c-876de0d6820b}\
set volume=\\?\Volume{59cc5e85-9403-425f-bd28-c22ed4e8ab8d}\
set volume=\\?\Volume{52fdf924-f0fb-4ba7-99e0-096a9c9d124a}\

:start
echo Mounting Drive...
mountvol %drive%: %volume%
echo Drive Mounted!

pause
exit

卸载

@echo off

REM Be sure to change this to the drive you want to unmount! 
set drive=E:

echo Unmounting Drive...
mountvol %drive% /p
echo Drive Unmounted!

pause
exit

任何帮助都将不胜感激。

答案1

安装卷 语法是:

mountvol [drive:]path VolumeName

该命令应如下所示:

mountvol %drive%:\myfolder %volume%

您可以尝试以下操作,但可能会失败,因为 Windows 不喜欢磁盘根目录中的文件:

mountvol %drive%:\ %volume%

运行时还要验证%drive%%volume%具有正确的值。

相关内容