如何将命令的输出插入批处理文件中的变量? [英] How to insert the output of a command to variable in a batch file?

查看:80
本文介绍了如何将命令的输出插入批处理文件中的变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows上的批处理文件中,我希望某些变量具有dir /b命令的输出.

Inside a batch file on Windows I would like some variable to have the output of dir /b command.

如何实现?

推荐答案

批处理文件不能很好地处理此用例.我确实找到了一个

Batch files didn't handle this use case very well. I did find one thread that describes a technique using temporary files.

这篇关于如何将命令的输出插入批处理文件中的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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