- @echo off&setlocal EnableDelayedExpansion
- set /p x=W外勤/Z主任:
- if /i "%x%"=="w" (set /p d="请输入视频日期,按回车键!(注意日期格式:2015-05-01):"
- cd /d h:\DCIM/100MEDIA\
- for /f "tokens=1-3*" %%a in ('dir /a:%-d% /t *.mov^|findstr /b [0-9]') do (
- if "%%a"=="!d:~,4!-!d:~5,2!-!d:~8,2!" echo f | xcopy "%%d" /y e:\视频\外勤\%d%\
- )
- ) else if /i "%x%"=="z" (set /p d="请输入视频日期,按回车键!(注意日期格式:2015/05/01):"
- cd /d h:\DCIM/100MEDIA\
- for /f "tokens=1-3*" %%a in ('dir /a:%-d% /t *.mov^|findstr /b [0-9]') do (
- if "%%a"=="!d:~,4!-!d:~5,2!-!d:~8,2!" echo f | xcopy "%%d" /y e:\视频\主任\%d%\
- )
- )
- IF not EXIST "e:\视频\外勤\%d%" (echo %d%,没有视频提取!) ELSE (echo %d%,提取视频完毕!
- )
- pause>nul
复制代码 按7楼老师的代码测试,仍然失败! |