如何在启动程序后关闭CMD

时间:2015-05-09 07:42:55

标签: windows batch-file cmd windows-xp

我写了一个批处理文件,在我想要的文件夹中打开两个CMD窗口,以便我可以运行服务器并输入命令。我也希望能够打开firefox和sublime编辑器。

一切正常,除了我留下的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上运行我的罪,所以如果有人可以提供帮助,我会很感激。

2 个答案:

答案 0 :(得分:2)

应该是

@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

答案 1 :(得分:0)

试试这个

@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:president@whitehouse.gov
::will start your e-mail program with a message addressed to...?