cmd for循环批处理相同事情,高效工作

@echo off
for /l %%f in (99930001,1,99930007) do (
md %%f
copy *.ini %%f
copy *.zip %%f
)

 

Using Multiple Commands in a For Loop

CMD lets you use multiple command lines after a for loop. This makes the Windows XP forcommand much more powerful than the old DOS version. In cases where you would have had to call a batch file subroutine in the past, you can now use parentheses to perform complex operations.

For example, this batch file examines a directory full of Windows bitmap (BMP) files and makes sure that there is a corresponding GIF file in another directory; if the GIF file doesn't exist, it uses an image-conversion utility to create one:

@echo off 
setlocal
echo Searching for new .BMP files...

for %%F in (c:\incoming\*.bmp) do (
    rem output file is input file name with extension .GIF
    set outfile=c:\outgoing\%%~nF.gif
    if not exist %outfile% (
         echo ...Creating %outfile%
         imgcnv -gif %%F %outfile%
    )
)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值