
// GETLABEL  返回名  盘符（无冒号）
_SUB GETLABEL
    EXEC*1  &&LBS=!CMD.EXE /C VOL %2:  
    MSTR %1=<-1>%&LBS%
_END


// MOUNT_LABEL   卷标     [盘符（无冒号,默认Z）     
_SUB MOUNT_LABEL
    ENVI &&LABEL0=%~1
    ENVI &&DRV0=%2 
    FIND  $ = %&DRV0%, ENVI  &DRV0=Z 
    
    ENVI &&LB=
    IFEX %DRV0%:\, GETLABEL  &LB   %&DRV0%  
    FIND $%&LABEL0% = %&LB%, EXIT _SUB 

    SUBJ *%DRV0%:,
    FDRV  DRIVES=*         //（无冒号）
    FORX * %DRIVES%,&&DRV,
    {
        GETLABEL  &LB   %&DRV%  
        FIND $%&LABEL0% = %&LB%,
        {
            PART -phy# list drv %&DRV%:,&&MSG
            MSTR &&prt=<2>NA  %&MSG%
            MSTR &&dsk=<10>%&MSG%
            SUBJ *%DRV%:,   //卸载旧盘符
            SHOW  *%&dsk%:%&prt%,%DRV0%:   //挂载到新盘符
        }
    }
_END

//示例 
// SHOW F:0    //SHOW F:-1  //确保已加载
// MOUNT_LABEL  L_DATA  Z 
// TEAM GETLABEL AA C|  MESS [%AA%]

