|
发表于 2012-12-21 14:15:39
|
显示全部楼层
饭大的
//盘符整理程序
CALL ORDER_DRIVE
//盘符整理子程序
_SUB FREEUSB
FORM &T=%D%
//TEAM FORM &T,&B=%D%| MESS T=[%T%] B=[%B%]
FIND %D%:\>0,!! FIND %D%:\>2,!TEAM ENVI &RP=%&D%| EXEC @=%WinDir%\System32\mount.cmd %D%:
FIND $%&T%=DRIVE_FIXED,!! FIND $%&RP%=NA,! SUBJ *%&D% //U盘后的固定磁盘
FIND $DRIVE_USBFLASH = %&T%, ENVI &T=DRIVE_USBDISK //USB软盘(DRIVE_USBFLASH) ,当作 USB硬盘(DRIVE_USBDISK)
FIND $%&T%=DRIVE_USBDISK,!! SUBJ *%&D% //U盘
FIND $%&T%=DRIVE_USBDISK,!! FIND $%&RP%=NA, ENVI &RP=%&D% //RP:第一个U盘
MSTR &D=%&I%,1,%&DRVS%
CALC &I=%&I% + 1
_END
_SUB ORDER_DRIVE
TEAM ENVI &&DRVS=CDEFGHIJKLMNOPQRSTUV****| ENVI &&I=2| ENVI &&D=C| ENVI &&RP=NA| ENVI &&T=| ENVI &&B= //初始化
LOOP $%&D%=*,! CALL FREEUSB
//重新加载HD,USB
SHOW *F:0
SHOW *U:-1,,,U
//登录后,重新加载USB
//RUNS PECMD.EXE EXEC PECMD.EXE TEAM WAIT 1000|SHOW U:0,U_DISK
_END
其中mount.cmd内容:
@echo off
FOR /F %%C IN ('mountvol %~d1 /L') DO (
mountvol %~d1 /D
mountvol W: %%C
)
但是不要mount.cmd 也行,不知道这个起什么作用? |
|