批处理文件移动,该怎么处理

批处理文件移动,该怎么处理

批处理文件移动
一个关于批处理的问题 一个文件夹test1里面有ch05_xx_20110809 ch05_yy_20110809 ch05_xx_20110709 ch05_yy_20110709 四个文件 想找出时间最晚的两个文件ch05_xx_20110809和 ch05_yy_20110809然后复制到另外一个文件夹test2中并且改名ch06_xx_20110809和 ch06_yy_20110809 有点棘手 望相各位助一下 小弟感激不胜~~


test.bat

BatchFile code

@echo off
setlocal enabledelayedexpansion
for /f "skip=2 delims=" %%a in ('dir /s /b /od "C:test1ch0*"') do (
set str=%%~na
copy "%%a" "C:test2!str:~0,2!06!str:~4,12!"
)

批处理文件移动,该怎么处理

相关文章:

你感兴趣的文章:

标签云: