Why does it open command prompt when i excute start hurry.bat?

时光怂恿深爱的人放手 提交于 2019-12-13 01:26:35

问题


This is about the START command in batch-files.

 start  notepad \\ opens the notepad but not the command prompt
 start  www.google.com   \\ opens the google.com but not the command prompt 
 start  hurry.bat\\ starts executing the batch file but opens the command prompt

Why so? Any reason ? Thank you in advance.


回答1:


notepad.exe is a graphic user inteface (GUI) program: it interacts with the user in GUI and doesn't need the console window (command prompt).

www.google.com is interpreted as an internet address, and in order to process it (open the corresponging internet page) Windows calls your default browser, which is a GUI program too, like notepad, so, again, no command prompt needed.

Now, a batch file is merely a text file containg a set of commands, a script. It cannot execute by itself and needs a program to interprete the commands. CMD.EXE (the 'command prompt') is exactly the program that does that job.



来源:https://stackoverflow.com/questions/6688738/why-does-it-open-command-prompt-when-i-excute-start-hurry-bat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!