- Jun
- 22
- 0
If you have virtual optical drives installed on system (with phantom-cd or similar) %_drives will fail and display also the unloaded virtual drives. An alternative detection is alldrv.btm (based on a script created by M. Austermeier -- many thanks to him):
setlocal
if isalias set unalias set
set drv=C
do until %drv == %@char[%@inc[%@ascii[%_lastdisk]]]
gosub drvSub
*set drv=%@char[%@eval[%@ascii[%drv]+1]]
enddo
echo.
endlocal
quit
:drvSub
iff %@cdrom[%drv] == 0 then
iff %@ready[%drv] == 1 then
iff isdir %drv:\ then
iff %drv == C .or. "%1" == "/c" then
echos %drv
else
echos %drv
endiff
endiff
endiff
endiff
return
This returns a list of really active drives which can be used e.g. in the alias
af=for %drv in (%@execstr[alldrv]) free %drv:
setlocal
if isalias set unalias set
set drv=C
do until %drv == %@char[%@inc[%@ascii[%_lastdisk]]]
gosub drvSub
*set drv=%@char[%@eval[%@ascii[%drv]+1]]
enddo
echo.
endlocal
quit
:drvSub
iff %@cdrom[%drv] == 0 then
iff %@ready[%drv] == 1 then
iff isdir %drv:\ then
iff %drv == C .or. "%1" == "/c" then
echos %drv
else
echos %drv
endiff
endiff
endiff
endiff
return
This returns a list of really active drives which can be used e.g. in the alias
af=for %drv in (%@execstr[alldrv]) free %drv: