我也写了一个,查找速度一般:- @echo off
- set "UNCPath=\\nfs02\setup\test"
- set "FindName=sky.mp3"
- set "DownDir=d:\temp"
- Call :_Find_Down_File_UNC "%UNCPath%" "%FindName%" "%DownDir%"
- echo Done!
- pause
-
- goto :eof
- :_Find_Down_File_UNC
- set "UNCPath=%~1"
- set "FindName=%~2"
- set "DownDir=%~3"
- set "TmpLog=%TEMP%\FindFileUNC.log"
- if not exist "%UNCPath%" goto :eof
- if ""=="%FindName%" goto :eof
- if not exist "%DownDir%" goto :eof
- pushd "%UNCPath%" >nul 2>nul || goto :eof
- dir /a-d /s /b "%cd%" > "%TmpLog%"
- for /f "delims=??" %%i in ('type "%TmpLog%"^|find /i "%FindName%"') do (
- REM if "%%~nxi"=="%FindName%" (
- echo %%i
- copy /v /-y /z "%%i" "%DownDir%\"
- REM )
- )
- popd
- goto :eof
复制代码
|