Need script to wait for copy to finish
Posted: 03 Apr 2020 00:09
I need a CBT that will copy a whole optical disk X:\ to a new hard drive folder T:\WORD\X, then eject the optical disk. I have multiple optical drives that I want to use concurrently, so actually three of these CBTs each for a different drive letter X, Y, Z.
So far this line of code works fine for the concurrent copying:
The second line, currently disabled, calls a NirSoft util to eject the disk - BUT the script continues past "copyto" without waiting for its completion. So the disk gets ejected prematurely.
I chose "copyto" because I need the custom copy feature of creating a new folder on collisions, and the flag for keeping all dates is nice to have. But it may not be the best choice. And I'm considering a wait loop until the drive reads not-busy, but I don't see any script command that can determine that status.
So I have three questions:
1 - Is there a way to do the copyto that will wait for completion / or another copy method ??
2 - Is there a way to check optical drive status?
3 - Incidentally, is there a better way to eject the optical disk?
So far this line of code works fine for the concurrent copying:
Code: Select all
copyto "T:\WORD\X", "X:\", ,2, , 4, 1;
//run "C:\_Util\NirSoft\NirCmd\nircmd.exe cdrom open x:"
I chose "copyto" because I need the custom copy feature of creating a new folder on collisions, and the flag for keeping all dates is nice to have. But it may not be the best choice. And I'm considering a wait loop until the drive reads not-busy, but I don't see any script command that can determine that status.
So I have three questions:
1 - Is there a way to do the copyto that will wait for completion / or another copy method ??
2 - Is there a way to check optical drive status?
3 - Incidentally, is there a better way to eject the optical disk?