首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > windows >

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

2012-01-10 
批处理文件移动一个关于批处理的问题一个文件夹test1里面有ch05_xx_20110809 ch05_yy_20110809 ch05_xx_20

批处理文件移动
一个关于批处理的问题 一个文件夹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 offsetlocal enabledelayedexpansionfor /f "skip=2 delims=" %%a in ('dir /s /b /od "C:\test1\ch0*"') do (    set str=%%~na    copy "%%a" "C:\test2\!str:~0,2!06!str:~4,12!") 

热点排行