我环顾四周,发现了一些有用的东西,但我对所有这些批次的东西都不熟悉。
我正在寻找一个批处理脚本,它将复制一个文件夹及其中的所有内容。该文件夹名为
包大师
然后我希望它制作该文件夹的 1,000 个副本并按顺序重命名每个副本:
AE 0001
到
AE 1000
如果有人能够提供帮助,如果他们也能解释这个过程,那就太好了,这样我就可以了解它是如何组合在一起的,并使自己处于更有利的位置,以便以后进行调整。
使用以下批处理文件:
@echo off
setlocal
setlocal EnableDelayedExpansion
rem loop 1000 times
for /l %%i in (1,1,1000) do (
rem prefix the count with leading zeros
set "_number=000%%i"
rem recursively copy the directory and its contents
rem target name is "AE " + 4 digit count with leading zeros
xcopy "Package Master" "AE !_number:~-4!" /s /i
)
endlocal
Run Code Online (Sandbox Code Playgroud)
例如,从 AE 0140 开始并从那里爬升?
只需for /l按如下方式更改循环:
for /l %%i in (140,1,1000) do (
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)FOR /L %%parameter IN (start,step,end) DO command钥匙
- 开始:第一个数字
- step : 增加序列的数量
- end : 最后一个数字
来源 -为 /l
| 归档时间: |
|
| 查看次数: |
1654 次 |
| 最近记录: |