如何在cmd /批处理脚本中导航到使用单个字符命名的子目录(仅使用通配符)? [英] How do I navigate to a subdirectory named with a single character using only a wildcard in cmd/batch script?
本文介绍了如何在cmd /批处理脚本中导航到使用单个字符命名的子目录(仅使用通配符)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我需要使用通配符 *
导航到子文件夹。
我当前的目录是 c:\Users \Test
我只有一个子文件夹 3
我要导航到 c:\Users\Test\3
p>
cd * //无效
cd *。 * / /不起作用
要导航的命令是什么?
您可以选择一个随机/ FOR-Loop找到的第一个目录> for / d %% A in(*)do cd %% A
Suppose I need to navigate to a sub-folder using the wildcard character *
. What is the command in cmd/batch script?
Example:
My current directory is c:\Users\Test
I have only one sub-folder as 3
I want to navigate to c:\Users\Test\3
cd * //doesn't work
cd *. * //doesn't work
What is the command to navigate?
解决方案
You could choose one random/the first directory found by a FOR-Loop
for /d %%A in (*) do cd %%A
这篇关于如何在cmd /批处理脚本中导航到使用单个字符命名的子目录(仅使用通配符)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文