代码1:
复制代码 代码示例:
@echo off
for %%a in (c d e f g h i j k l m n o p q r s t u v w x y z)do (
for /f "delims=" %%b in ('dir /a/b/s "%%a:GeosetManager50.exe"')do (
copy mapx50.lic "%%~dpb" /y
))
pause
代码2:
复制代码 代码示例:
@echo off
rem 系统要求WinXP以上
SetLocal EnableDelayedExpansion
for /f "delims=" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set "var=%%i"
set "drive=!var:~-2!"
fsutil fsinfo drivetype !drive!|find "固定">nul &&call :slz "!drive!"
)
echo 任务已完成&pause
代码3:
复制代码 代码示例:
:slz
if "%~1"=="" goto:eof
for /f "delims=" %%a in ('dir/s/b/a-d "%~1GeosetManager50.exe" ^>nul 2^>nul') do (
set "var2=%%~dpa"
if defined var2 xcopy /y/h/r mapx50.lic "%var%"
)
set "var2="
goto:eof
代码4:
复制代码 代码示例:
SetLocal EnableDelayedExpansion
for /f "delims=" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul & for /f "delims=" %%a in ('dir/s/a-d/b !drive!GeosetManager50.exe 2^>nul') do copy "mapx50.lic" "%%~dpa" /b /y
) & pause