首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

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

2014-01-03 
cmd for循环批处理相同事情,高效工作@echo offfor /l %%f in (99930001,1,99930007) do (md %%fcopy *.ini

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

@echo offfor /l %%f in (99930001,1,99930007) do (md %%fcopy *.ini %%fcopy *.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 setlocalecho 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%    ))

热点排行