返回列表 发帖

[文件操作] 求指导解决批处理将多个文件按指定数量/数目移动到不同文件夹里出现的一些问题

本帖最后由 pcl_test 于 2016-11-13 16:02 编辑
@echo off
setlocal enabledelayedexpansion
set count=0
set hundred=100
set file=1
for %%i in (*.gif) do (
set /a count+=1
if not exist !file! (
md !file!
move "%%i" !file!
) else (
move "%%i" !file!
)
if !count! equ !hundred! (
set /a count=0
set /a file+=1
)
)COPY
这是我写的一段代码,主要解决文件的移动(每100个gif图移动到一个数字编号的文件夹)。现学现写的,所以有些问题:
1.setlocal enabledelayedexpansion我查相关资料时,有要endlocal,这里要不要写;这个延迟是针对整个for的存在周期吗
2.有三个文件没有移动:
青年图摘0204! - Pow_20160204_13099065706496000_000.gif
青年图摘0204! - Pow_20160204_13099065713274000_000.gif
是我想太多! 你总这样说~ -_20160212_13099761875492600_000.gif
不知道什么原因?
3.还有就是各位大神对这个小程序有没有建议什么的,第一次编写很想听听大家的看法

自顶一贴

TOP

返回列表