本帖最后由 WisdomFusion 于 2014-7-19 15:16 编辑
如当前文件夹里有
111.zip
222.zip
333.zip
...
想批量move成
111_h7ye.zip
222_ui89.zip
333_7hy9.zip
...
下面是我测试用的代码,一直调不通,请高手帮忙看看,谢谢- @ECHO OFF & SETLOCAL EnableDelayedExpansion
- FOR %%f IN (DIR /B *.zip) DO (
- SET file=%%f
- SET "file=!file:.zip=!"
-
- set pas=
- set s=abcdefghijklmnopqrstuvwxyz1234567890
- set m=0
- :loop
- set /a n=%random% %% 36
- call set pas=%pas%%%s:~%n%,1%%
- set /a m=m+1
- if not %m%==4 goto loop
-
- MOVE "%%f" "!file!_%pas%.zip"
- )
复制代码
|