如何遍历Windows批处理文件的文件夹树/子树? [英] How to traverse folder tree/subtrees in a windows batch file?

查看:313
本文介绍了如何遍历Windows批处理文件的文件夹树/子树?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows批处理文件,有没有办法来遍历文件夹/子文件夹层次结构在做一些动作上的每个文件?

In a windows batch file, is there a way to traverse a folder/subfolders hierarchy doing some action on each file?

推荐答案

是的,你可以使用与命令这样做的 / R 开关,例如:

Yes, you can do this using the for command with the /r switch, e.g.:

for /r %%f in (*) do echo %%f

又见<一个href=\"http://stackoverflow.com/questions/717171/recursive-renaming-file-names-folder-names-with-a-batch-file\">this问题一个例子。

这篇关于如何遍历Windows批处理文件的文件夹树/子树?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆