English 中文(简体)
收集批量文档后,从前方闪lash和问题标记开始。
原标题:Escaping a batch file echo that starts with a forward slash and question mark

Bit。 我怎么能够正确地在批量档案中逃脱以下内容?

echo    /?   display this help text

这种特殊特性组合被视为“ECHO /?”指挥:

C:Batch>ECHO       /?    display this help text
Displays messages, or turns command-echoing on or off.

  ECHO [ON | OFF]
  ECHO [message]

Type ECHO without parameters to display the current echo setting.

它对照料、照料和照料没有反应。 I ve Trial ^/? /^? 和 ^/^?

NB:作为整体工作,我发现,在两者之间插入其他特性足以绕过欧洲人道处指挥线程序员,例如:

echo ...   /?   display this help text

然而,这并不理想,我想知道,在发出呼应信息时,是否有办法调和预期产出。

最佳回答

escaping 重复论点,您可使用替代的辛加税代码<>echo.:

echo./?
问题回答

For escaping echo arguments exists many variants, like echo., echo:, echo=
But only echo( seems to be secure against any appended text.

These one fails, if files exists like echo, echo[, echo] or echo+

echo.
echo[
echo]
echo+

These one fails, if a file in the current directory exists named my.bat

echo..my.bat
echo:..my.bat
echo...my.bat

这些人没有独立档案

echo/?
echo,/?
echo;/?

只有<代码>echo()似乎总是可以安全地反对任何内容。





相关问题
How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

Do I need to escape this?

It might be a bit unusual, but I need to echo <?php. However, I think that PHP treats it as an actual <?php and starts executing code instead of treating it as a string. How can I escape <?...

热门标签