Receive error msg: the parameter is incorrect

1

i receive this error msg when i use this batch file to mount and unmount a drive in windows 10.

mounting:

@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

unmount:

@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

Any help will be really appreciated.

Michel Marcouiller

Posted 2019-12-16T14:43:28.990

Reputation: 13

Show a session with the error message. Take off the @echo off so the error will be visible. – harrymc – 2019-12-16T14:53:45.413

C:\WINDOWS\system32>mountvol %drive%: %volume% The parameter is incorrect. – Michel Marcouiller – 2019-12-16T15:02:50.467

Answers

0

The mountvol syntax is:

mountvol [drive:]path VolumeName

The command should look like:

mountvol %drive%:\myfolder %volume%

You could try the following, but it risks failure because Windows doesn't like files on the root of the disk:

mountvol %drive%:\ %volume%

Verify also that %drive% and %volume% have the correct values when running.

harrymc

Posted 2019-12-16T14:43:28.990

Reputation: 306 093

We are on a good track!! made it work removing all the others drives in the list, left only the one I want to mount. Used this line: mountvol %drive%:\ %volume%. Will try to add all other drives now. – Michel Marcouiller – 2019-12-16T16:30:27.593