English 中文(简体)
除此以外,还展示了电文。
原标题:Echo off but messages are displayed

我在批号中驳斥了反响。

@echo off

那么,我就这样做了。

...
echo %INSTALL_PATH%
if exist %INSTALL_PATH%(
echo 222
...
)

我收到:

该系统无法找到具体的道路。

这两者之间的信息相呼应。

发出这一信息的原因何在,信息为何被忽视?

最佳回答
问题回答

除此以外 * 逐项存档,看差异

:: print echo command and its output
echo 1

:: does not print echo command just its output
@echo 2

:: print dir command but not its output
dir > null

:: does not print dir command nor its output
@dir c: > null

:: does not print echo (and all other commands) but print its output
@echo off
echo 3

@echo on
REM this comment will appear in console if  echo off  was not set

@set /p pressedKey=Press any key to exit

不能忽视“选择”。 “选择”是指你不想重复指挥,也不说指挥所制造的错误。

你所显示的线索,因此问题很可能没有。 因此,请向我们展示更多内容。 另外,请向我们说明INSTALL_PATH的确切价值。

@echo off
// quote the path or else it won t work if there are spaces in the path
SET INSTALL_PATH="c:\etc etc\test";
if exist %INSTALL_PATH% (
   //
   echo 222;
)

For me this issue was caused by the file encoding format being wrong. I used another editor and it was saved as UTF-8-BOM so the very first line I had was @echo off but there was a hidden character in the front of it.

So I changed the encoding to plain old ANSI text, and then the issue went away.

作为ANSI的储蓄文件

页: 1





相关问题
complex batch replacement linux

I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...

How to split a string by spaces in a Windows batch file?

Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]

How to check which Operating System?

How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....