为什么是“回声%VAR%”没有字符串输出使用“设置VAR =文本”命令行上后? [英] Why is no string output with 'echo %var%' after using 'set var = text' on command line?

查看:92
本文介绍了为什么是“回声%VAR%”没有字符串输出使用“设置VAR =文本”命令行上后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我CMD设置一个变量在Windows 8.1中使用设置命令,并试图呼应吧。

I set a variable in CMD on Windows 8.1 with the set command, and tried to echo it.

下面是一个例子:

 C:\Users\Logan>set var = text

 C:\Users\Logan>set var
 var = text

 C:\Users\Logan>echo %var%
 %var%

 C:\Users\Logan>

那么,有没有办法强制命令提示符呼应变量,而不是原始的文字?

So is there a way to force the command prompt to echo the variable, not the raw text?

推荐答案

您需要从等号带来更接近你的文字:

You need to bring closer your text from the equal symbol :

set var=text
echo %var%
text

这篇关于为什么是“回声%VAR%”没有字符串输出使用“设置VAR =文本”命令行上后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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