在一个目录下边快速创建大量文件及目录(使用dos batch)

来源:互联网 发布:php可视化编辑器 编辑:程序博客网 时间:2024/05/01 17:44

 

@echo off

set num=100000

REM for /L %%i in (1,1,%num%) do echo "here is %%i"
if not exist tmp mkdir tmp
REM ~ for /L %%i in (1,1,%num%) do touch "tmp/abc%%i.txt"
for /L %%i in (1,1,%num%) do echo "abc%%i" > "tmp/abc%%i.txt"
for /L %%i in (1,1,%num%) do mkdir tmp"abc%%i"

dir/b/s tmp > tmp.txt

for /"usebackq delims==" %%i in (`dir/b/s tmp`) do @echo %%i
for /"usebackq delims==" %%i in (`dir/b/s tmp`) do @del/s/q %%i
for /"usebackq delims==" %%i in (`dir/b/s tmp`) do @rmdir/s/q %%i

@echo on 

纯粹为了作实验使用的,有兴趣的可以一试。使用python之类的,也会很简单。批处理有时候用起来也还是蛮方便的。

 

<script type="text/javascript"><!--google_ad_client = "ca-pub-7104628658411459";/* wide1 */google_ad_slot = "8564482570";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击