简体   繁体   English

如何从其他程序的输出设置Windows命令提示符的环境

[英]How to setting Windows Command Prompt's environment from other program's output

我们也可以从文件中设置Windows命令提示符的环境。

To set command prompt from other program's output: 要从其他程序的输出设置命令提示符:

for /F "delims=" %%a in ('anyprog param1 param2') do set PROMPT=%%a

To set command prompt from file: 要从文件设置命令提示符:

set /P PROMPT=< anyfile.txt
echo|set /p=set QT_INSTALL_BINS=>%Temp%\_run_temp.bat
qmake -query "QT_INSTALL_BINS">>%Temp%\_run_temp.bat
call %Temp%\_run_temp.bat
del %Temp%\_run_temp.bat
echo %QT_INSTALL_BINS%

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

相关问题 在Windows命令提示符下获取命令输出的列值 - Get column value of command's output in windows command prompt 如何从 windows 命令提示符在虚拟环境中运行 python 程序? - How do I run a python program in a virtual environment from windows command prompt? 如何从 Windows 10 命令提示符激活虚拟环境 - How to activate virtual environment from Windows 10 command prompt 如何在Windows机器上从命令提示符运行PHP程序? - How to run a PHP program from command prompt on a Windows Machine? 如何随时捕获Windows中命令提示符的显示输出? - How to capture display output from a command prompt in Windows at any moment? 是否从程序修改Windows命令提示符历史记录? - Modify Windows Command Prompt History from a Program? Windows中有命令提示符刷新环境变量的命令吗? - Is there a command to refresh environment variables from the command prompt in Windows? 设置为父级标准IO时,Windows Java子进程不输入或输出(命令提示符) - Windows Java child process doesn't input or output when set to parent's standard IO (Command Prompt) 如何从命令提示符下访问环境变量? - How to access environment variable from command prompt? 在本机窗口中运行两个命令提示符终端,如何将一个输出重定向到另一个输入? - Running two command prompt terminals in native windows, how can I redirect the output of one to the input of the other?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM