windows @title 批处理脚本命令有什么作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1493979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:46:49  来源:igfitidea点击:

What does the @title batch script command do?

windowsbatch-file

提问by Thomas Owens

I see it a few times in my batch script, however I'm not certain what it actually does. The two occurrences of it are below an @echo (which prints out the text following it to the console) and are exact duplicates of the text that is printed with @echo.

我在批处理脚本中看到它几次,但是我不确定它实际上做了什么。它的两次出现在@echo(将其后面的文本打印到控制台)下方,并且与@echo 打印的文本完全相同。

回答by i_am_jorf

  • @means "don't echo this, just run it."
  • titlelets you set the title of the cmd.exe window.
  • @意思是“不要回应这个,只是运行它。”
  • title允许您设置 cmd.exe 窗口的标题。

Try title /?from the command prompt.

title /?从命令提示符尝试。

回答by Pesto

Not surprisingly, it sets the titleof the command prompt window the batch is running in. The leading @keeps the line from being echo'd to the prompt.

毫不奇怪,它设置了批处理正在运行的命令提示符窗口的标题。前导@可以防止该行被回显到提示中。

回答by RedFilter

It sets the title of the current command window title bar.

它设置当前命令窗口标题栏的标题。

If you run the following script as a batch file, you will see an example:

如果您将以下脚本作为批处理文件运行,您将看到一个示例:

@title = "My Title"
pause

回答by adrianbanks

It "specifies the title for the command prompt window" (found by running title /?).

它“指定命令提示符窗口的标题”(通过运行找到title /?)。