无法显示环境变量的值 [英] Unable to display the value of environment variable
本文介绍了无法显示环境变量的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在code是如下
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
cd/
if exist c:\programdata\intel\pre (
if exist c:\Locker (
move c:\Locker c:\programdata\intel
rename c:\programdata\intel\Locker UI
attrib c:\programdata\intel\UI +h +s
) else (
echo Enter the password of the locker:-
set /p pass1=
echo %pass1% )
)
ENDLOCAL
现在,当我作为输入密码1234则显示回声关,但是当我在一个单独的文件执行下面的code,它正确执行,
Now when I enter the password as "1234" it displays "echo is off", but when I execute the below code in a separate file, it executes correctly,
set /p pass1=
echo %pass1%
批处理程序的这种行为只是我发疯,请指导我.....
This behavior of the batch program is just driving me nuts, kindly guide me through.....
推荐答案
延迟扩展使用这样的:
echo !pass1!
这篇关于无法显示环境变量的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文