BAT批处理,自动查找文件并复制文件
我想做一个批处理文件:自动查找GeosetManager50.exe文件并把bat文件目录下的mapx50.lic文件拷到GeosetManager50.exe所在文件夹...
我想做一个批处理文件:
自动查找GeosetManager50.exe文件并把bat文件目录下的mapx50.lic文件拷到GeosetManager50.exe所在文件夹并覆盖原文件 展开
自动查找GeosetManager50.exe文件并把bat文件目录下的mapx50.lic文件拷到GeosetManager50.exe所在文件夹并覆盖原文件 展开
展开全部
@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
:slz
if "%~1"=="" goto:eof
for /f "delims=" %%a in ('dir/s/b/a-d "%~1\GeosetManager50.exe" ^>nul 2^>nul') do (
set "var2=%%~dpa"
if defined var2 xcopy /y/h/r mapx50.lic "%var%"
)
set "var2="
goto:eof
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
:slz
if "%~1"=="" goto:eof
for /f "delims=" %%a in ('dir/s/b/a-d "%~1\GeosetManager50.exe" ^>nul 2^>nul') do (
set "var2=%%~dpa"
if defined var2 xcopy /y/h/r mapx50.lic "%var%"
)
set "var2="
goto:eof
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
@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
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
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |