批处理(bat)拷贝文件夹内的全部文件到另一个文件夹

@echo off
set LibDir=C:\WINCE600\PLATFORM\HPC-3200\lib\EPC-3000
set LibSourceDir=C:\WINCE600\PLATFORM\HPC-3200\EPC-3000
dir /a /b %LibDir%|findstr .>nul 2>nul && goto havefiles || goto nofiles

:havefiles
rem echo 有文件
goto endbat

:nofiles
rem echo 没有文件
XCOPY %LibSourceDir% %LibDir%
taskkill /f /im "CopeLib.exe"
pause

:endbat

你可能感兴趣的:(Bat)