如何在启动程序后关闭CMD

问题描述:

我已经写了一个批处理文件,该文件在我想要的文件夹中打开两个CMD窗口,以便我可以运行服务器并键入命令。我也希望能够打开Firefox和崇高的编辑器。如何在启动程序后关闭CMD

一切工作,除了我留下4厘米的窗户,不只是我想要的两个。

@ECHO OFF 
start cmd.exe /K "cd C:\xampp\htdocs\restful" 
start cmd.exe /K "cd C:\xampp\htdocs\restful" 
cd "C:\Program Files\Mozilla Firefox\" 
start cmd.exe /K "firefox.exe" 
cd "C:\Program Files\Sublime Text 3\" 
start cmd.exe /K "sublime_text.exe" 
exit 

我在Windows XP上运行我的罪,所以如果任何人都可以帮助,我将不胜感激。

+0

为什么开始'cmd'刚开始的'exe',而不是刚刚开始的' exe'?另外一定要知道'cmd/k'和'cmd/c'之间的区别。 – Stephan

应该

@ECHO OFF 
start cmd.exe /K "cd C:\xampp\htdocs\restful" 
start cmd.exe /K "cd C:\xampp\htdocs\restful" 
cd "C:\Program Files\Mozilla Firefox\" 
start firefox.exe 
cd "C:\Program Files\Sublime Text 3\" 
start sublime_text.exe 
exit 

试试这个

@ECHO OFF 
start cmd /K "cd C:\xampp\htdocs\restful" 
start cmd /K "cd C:\xampp\htdocs\restful" 

start iexplore.exe 
start Safari.exe 
exit 

start "" "C:\users\YourUserName\Desktop\firefox.exe" 
or 
start "" "C:\Program Files (x86)\and Rest of the path" 

一些例子:[ Link ]

START C:\MyFiles\Myletter.doc 
::will open the file Myletter.doc in Word or WordPad 

START \\server\printer 
::will ask if you want to install the printer, install the printer driver and then connect to the network printer 

START C:\WINNT\System32\ssmarque.scr /C 
::will open the configuration dialogue for the 3D text screen saver, whereas 

START C:\WINNT\System32\ssmarque.scr /S 
::will run the screen saver itself 

START http://www.googl.com 
::will open Google's search page in your browser 

START mailto:[email protected] 
::will start your e-mail program with a message addressed to...? 
+0

适用于笔记本,不适用于firefox或崇高的文本,您可以建议任何其他的东西。 –

+0

我没有Firefox,但我在IE浏览器上测试胜利7-看到编辑后 – 0m3r