Clewd - Copy-Load-Eject-Wait-for-Disc utility
Clewd - utility for: Copying, Loading, Ejecting, Waiting discs.
Clewd designed for use only under Windows NT/2k/XP/03S/etc, not testes under Win95/98/ME (should works).
Clewd will not compiling under *nix OSs (Linux/BSD/Solaris/etc), use cdtool instead clewd.
clewd -w 2 (wait for inserting disc in second optical drive)
clewd -e z: (eject z: drive, if possible, without drive type checking)
clewd (without parametrs) load, if disc not load, eject if load
Clewd can autodetect a drive letter. By default, it will try to use a first (in alphabetical order) avaible optical drive. You can directly specify a drive type by letter, or say to autodetect first/second/third/etc optical drive in system. To use second drive just put 2 as parameter in command line, e.g. clewd -l 3 try to load tray in third drive.
Of course, if no third drive in system, clewd just report error about this.
If no drive letter/number specified, clewd will perform operation with first optical drive in system.
N.B. Clewd works only with mounted to letter drives, if you are mount CD-ROM as, c:\dev\cdrom, this will not be counted. :)
N.B. If you set drive letter directly (e.g. b:, c:, d:, etc) clewd will try to eject without drive checking. (if you try to eject a flashdrive, it will just mount/unmount it, not physically eject :)
N.B. Theoretically, clewd can works with 'strange' device names, e.g. ]:, [: ~:, etc (you can make it by subst command), but can not autodetect them.
-l - load disc
-e - eject disc
-i - inverse state (load if no CD, eject if loaded)
-t - test status (set ERRORLEVEL depends on disc status)
-w - wait until disc will be inserted, report fail, if user break
-c - copy (all) files from disc to current directory (recursive)
-cl - create a directory with name same as disc label and copy all files (recursive) from disc to this folder.
-s - do not print anything on sceeen (silent mode)
Operations (except -s) couldn't be combined (you can not say clewd -l -c, you should call clewd -l && clewd -c) -s can be attached to any command (e.g. clewd -c -s, clewd -l -s, etc)
Clewd sets a followed errolevels:
-l -e -i: 0 - OK, operation sucessfull, nonzero - oops, operation fail
-t: 0 - disc inserted, nonzero - no disc
-w: 0 - disc inserted, nonzero - user cancel operation by pressing a key or empy (non readable) disc inserted
-c, -cl: 0 - ok, files copied, other codes depending on xcopy sets of errorlevel.
Some of extended errolevels10 - error in command line
11 - incorrect drive letter
12 - no label (for -m mode)
13 - autodetect fail (no CD in system if detecting first drive)
14 - error creating dir (-cl mode)
15 - error creating/changing dir (-cl mode)
16 - internal error
17 - ask for copy file from CD, but no CD
cdcp.bat is a interesing sample of use clewd.
cdcp.bat just copy to current dir all files from CD, eject drive, waiting until user inserting other and continue copying.
I'm use it for copy heads of CDs to hard disk in background without stopping a movie. ^_~
N.B. Please, do not try to use cdcp with flash drives.
© George Shuklin, 2004, GNU GPL. email@example.com