- 帖子
- 37
- 积分
- 224
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2009-8-28
|
原帖由 Lumiere 于 2009-9-17 12:24 发表
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in ('dir /ad /b') do (
set "str=%%a"&set "head=!str:~0,-5!"&set "tail=!str:~-4!"
if exist !head! move %%a !head!\!tail!
) ...
谢谢Lumiere,解决了,但是仍有点理解不过来,望能注释一下,主要是这句
if exist !head! move %%a !head!\!tail!
如果存在!head!这个文件夹,就移动%%a
这时移动的%%a为什么一定是含有那四位字符的文件夹?(如:package_aaa_wok_0804) |
|