简体   繁体   English

如何在Windows命令行中的环境变量中读取文件的内容?

[英]how to read content of a file in a environment variable in windows command line?

is there an equivalent in Windows Command to the following command in bash : Windows命令中是否有与bash中以下命令等效的命令:

variable='cat mytextfile'

I found answers on the net, but they use loop or complicated ways... they're is probably a simple way to do it? 我在网上找到了答案,但是它们使用循环或复杂的方法……它们可能是一种简单的方法?

我使用以下命令对我有用

set /p myVar=<myFile.txt

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows 命令行:不评估环境变量 - Windows Command Line: Non Evaluation of Environment Variable 如何在Windows批处理中将环境变量的内容添加到文件中? - How do I add the content of an environment variable to a file in windows batch? 为什么 python 不读取环境变量并且无法运行 windows 命令行? - Why python doesn't read the environment variable and can't run a windows command line? 使用Windows命令行将多行环境变量回显到文本文件 - Echo a multi line environment variable to a text file using Windows Command Line Windows:如何从外部文件读取命令行选项? - Windows: How to read command-line options from external file? 如何在 windows 命令提示符中设置具有多行文件内容的环境变量 - How to set an env variable with multiline file content in windows command prompt 为什么Windows的“路径”环境变量和命令行不同? - Why are “Path” Windows's environment variable and the command line different? Windows命令行:为什么环境变量在&之后不可用 - Windows command line: why environment variable is not available after & 如何使用 Windows 命令行环境查找和替换文件中的文本? - How can you find and replace text in a file using the Windows command-line environment? 为什么 for 循环中的单个 % 在命令行中没有被解释为环境变量,而是在批处理文件中? - Why is a single % in a for loop not interpreted as an environment variable at the command line but it is in a batch file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM