如何抓住所有子文件夹的名称在批处理脚本? [英] How to grab the names of all sub-folders in a batch script?

查看:212
本文介绍了如何抓住所有子文件夹的名称在批处理脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道我怎么能得到的文件夹中的所有名称在当前目录。例如,在我的当前目录中我有三个文件夹:

I just want to know how can I get all the names of the folders in a current directory. For example in my current directory I have three folders:


stackoverflow
reddit
codinghorror

后来,当我执行我的批处理脚本所有的三个文件夹将打印在屏幕上。

Then when I execute my batch script all the three folders will print in the screen.

我怎样才能做到这一点?

How can I achieve this?

推荐答案

使用批处理文件:

for /d %%d in (*.*) do echo %%d

如果你想测试在命令行中,只使用一个%符号在这两种情况下。

If you want to test that on the command line, use only one % sign in both cases.

这篇关于如何抓住所有子文件夹的名称在批处理脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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