本帖最后由 smss 于 2020-4-29 20:42 编辑
- @echo off
- wmic diskdrive get serialnumber |find "Z4Z959F6"&&goto A||echo 非我司U盘即将退出!&&ping 0 -n "2">nul&&Exit
- :A
- for /f "delims=:" %%i in ('findstr /n "^:DynamicScript$" "%~f0"') do (more +%%i "%~f0" > "%temp%\GetU.vbs")
- for /f %%a in ('cscript /nologo "%temp%\GetU.vbs"') do (set "DriveU=%%a")
- echo 正在格式化U盘
- format %DriveU% /fs:fat32 /q /x
- echo 正在复制文件夹
- xcopy /d/e/I/h/r/y/s XXXXX %DriveU%
- pause
- :DynamicScript
- Set Fso = CreateObject("Scripting.FileSystemObject")
- Set B = Fso.Drives
- For Each A in B
- If A.DriveType = 1 Then
- aDisk = aDisk & A.DriveLetter & ": "
- End If
- Next
- aDisk = Replace(aDisk, "A: ","")
- WScript.Echo aDisk
复制代码
|