I am trying to copy the contents of multiple .iso images to a directory. I created a batch file for this, which mounts the .iso file in Virtual Clone Drive, and then it starts copying. However, Daemon.exe returns before the mounting is finished. I want to continue only once the virtual drive is accessible, so I inserted a loop to wait for it, like this:
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\Daemon.exe" -mount "%imagefile%" "%drive%"
:loop
if not exist "%drive%\" (
sleep 1
goto :loop
)
xcopy "%drive%\" "%tempfolder%" /e /h /i /r /y
It does not really work because at the if not exist line a dialog window appears:
cmd.exe - No Disk
There is no disk in the drive. Please insert a disk into drive V:.
Cancel Try Again Continue
This way the batch file does not work automatically because I have to press one of the buttons.
How can I avoid this dialog?
[Update] As Appleoddity pointed out, there is no sleep command in cmd, so I updated the code:
"C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\Daemon.exe" -mount "%imagefile%" "%drive%"
:loop
if not exist "%drive%\" (
timeout 1 /nobreak > nul
goto :loop
)
xcopy "%drive%\" "%tempfolder%" /e /h /i /r /y
[Update] Here are two pictures: before and after pressing the enter to execute vcd.bat.