1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

alternative to %_drives

Discussion in 'T&T - Scripting' started by wbiebel, Jul 25, 2008.

  1. wbiebel

    wbiebel

    Messages:
    22
    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:

Share This Page