I have created a small command that will let me launch Internet Explorer. However, I wish to close the small command prompt that shows up when I launch IE. How can I do this? This is my current code:
我创建了一个小命令,可以启动Internet Explorer。但是,我希望关闭启动IE时出现的小命令提示符。我该怎么做呢?这是我目前的代码:
"%ProgramFiles%\Internet
Explorer\iexplore.exe"
http://localhost/test.html
PAUSE
I am guessing if I take out the Pause. It will close the CMD box upon closing IE??
我猜我是不是把暂停去掉了。它将关闭CMD箱在关闭IE??
Also is there another command that I can use to simply create a command that will let me add something to the Menu with a small icon, which in turn runs the above. Is this complicated? Any tutorials I can use?
另外,我还可以使用另一个命令来创建一个命令,让我用一个小图标向菜单中添加一些东西,而这个小图标又可以运行上面的命令。这是复杂的吗?我可以使用任何教程吗?
Thanks all
感谢所有
5 个解决方案
#1
12
Use the start
command:
使用启动命令:
start "title" "%ProgramFiles%\Internet Explorer\iexplore.exe" http://www.example.com
#2
6
you need this on the end
你最后需要这个。
&& exit
For example
例如
"%ProgramFiles%\Internet Explorer\iexplore.exe" http://google.co.uk && exit
#3
2
@echo off
start "" "%ProgramFiles%\Internet Explorer\iexplore.exe" "http://www.example.com"
exit /b
But you really should not force IE, but use the default browser:
但是你真的不应该强迫IE,而是使用默认浏览器:
@echo off
start http://www.example.com
exit /b
exit /b does not work on win9x IIRC, so if you need to support every version of windows and close the terminal window if the user double clicks your batch file, go with:
exit /b对win9x IIRC不起作用,所以如果你需要支持每个版本的windows,如果用户双击你的批处理文件,你需要关闭终端窗口:
@echo off
start http://www.example.com
cls
#4
1
You can also launch your program with the /c
switch, which terminates the cmd once its finished executing
您还可以使用/c开关启动您的程序,一旦cmd完成执行,该开关将终止cmd
for example
例如
cmd /c "%ProgramFiles%\InternetExplorer\iexplore.exe" http://localhost/test.html
#5
0
You have to add 'start' in front of every program you launch, elsewhere your script is going to wait until it's finished.
你必须在每一个你启动的程序前添加“开始”,在其他地方你的脚本将等待它完成。
#1
12
Use the start
command:
使用启动命令:
start "title" "%ProgramFiles%\Internet Explorer\iexplore.exe" http://www.example.com
#2
6
you need this on the end
你最后需要这个。
&& exit
For example
例如
"%ProgramFiles%\Internet Explorer\iexplore.exe" http://google.co.uk && exit
#3
2
@echo off
start "" "%ProgramFiles%\Internet Explorer\iexplore.exe" "http://www.example.com"
exit /b
But you really should not force IE, but use the default browser:
但是你真的不应该强迫IE,而是使用默认浏览器:
@echo off
start http://www.example.com
exit /b
exit /b does not work on win9x IIRC, so if you need to support every version of windows and close the terminal window if the user double clicks your batch file, go with:
exit /b对win9x IIRC不起作用,所以如果你需要支持每个版本的windows,如果用户双击你的批处理文件,你需要关闭终端窗口:
@echo off
start http://www.example.com
cls
#4
1
You can also launch your program with the /c
switch, which terminates the cmd once its finished executing
您还可以使用/c开关启动您的程序,一旦cmd完成执行,该开关将终止cmd
for example
例如
cmd /c "%ProgramFiles%\InternetExplorer\iexplore.exe" http://localhost/test.html
#5
0
You have to add 'start' in front of every program you launch, elsewhere your script is going to wait until it's finished.
你必须在每一个你启动的程序前添加“开始”,在其他地方你的脚本将等待它完成。