TEAM ENVI^ ENVIMODE=1| ENVI^ FORCELOCAL=1
IFEX X.LOG, LOGS **ln=1  X.LOG
//FIndActive  Drv DrvRetName [HdRetName  PtRetName]
_SUB FIndActive
    SET &drv=%~1
    ENVI-ret %~2=
    ENVI-ret %~3=
    ENVI-ret %~4=
    FIND $%drv%=, SET drv=%&CurDrv%
    PART list drv %Drv%,&&V
    MSTR &&hd=<9>%&V%
    FIND $%&hd%=, EXIT 
    PART list part %&hd%,&&pts
    SET &hdx=
    SET &ptx=
    SET &drvx=
    FORX * %&pts%,&&p1,
    {*  PART -phy# list part  %&hd%:%&p1%,&&vi
        MSTR &&act,&&pt1,&&drv1=<3><8><9>%&vi%
        IFEX $%act%=1, TEAM SET ptx=%&pt1%| SET hdx=%&hd%| set drvx=%&drv1%| EXIT 
    }
    ENVI-ret %~2=%&drvx%
    ENVI-ret %~3=%&hdx%
    ENVI-ret %~4=%&ptx%
_END

SET &drv1=D:
FIndActive   %&drv1%  &&drvact &&hdact &&ptact   
FIND $%&drvact%<>, MESS 磁盘%&drv1% 有活动分区  盘符:%&drvact%  磁盘号:%hdact% 物理分区号:%&ptact% 
FIND $%&drvact%=,  MESS 磁盘%&drv1% 没有活动分区   