如何运行.bat文件没有一个终端(剩余开)? [英] How do I run a .bat file without a terminal (remaining open)?
问题描述
我要运行使用.bat一个jar文件(jar文件似乎并不想对自己开放,但多数民众赞成在一个不同的问题现在),但作为Java文件运行很长一段时间,该命令提示保持打开状态(而蝙蝠/的.jar仍在运行)
I want to run a jar file with a .bat (the jar file doesn't seem to want to open on its own but thats a different issue for now) but as the java file runs for a long time, the command prompt remains open (while the .bat/.jar is still running)
我不希望这样。
我读的地方,你可以使用一个.cmd文件和命令(S):
I read somewhere that you can use a .cmd file and the command(s):
cmd /c bat.bat
exit
要运行一个批处理文件不带命令提示符。但是,这不是为我工作。当我点击.cmd程序所它只是打开一个命令promopt和循环一遍又一遍地不断打印CMD / C bat.bat退出。
To run a bat file without a command prompt. But that isn't working for me. When I click the .cmd program it just opens a command promopt and keeps printing "cmd /c bat.bat exit" over and over in a loop.
我在做什么错,是我的.cmd命令错了吗?有另一种方式来运行没有命令提示符.BAT保持开放?
What am I doing wrong, was my .cmd command wrong? Is there another way to run a .bat without a command prompt remaining open?
非常感谢。
推荐答案
从<一个href=\"http://superuser.com/questions/140047/how-to-run-a-batch-file-without-launching-a-command-window\">here:
以下内容作为WScript的,例如,hidecmd.vbs后
与您的批处理文件的名称替换testing.bat。
Save the following as wscript, for instance, hidecmd.vbs after replacing "testing.bat" with your batch file's name.
Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
strArgs = "cmd /c testing.bat"
oShell.Run strArgs, 0, false
基准是在这里
http://msdn.microsoft.com/en-us/library/d5fk67ky.aspx
这篇关于如何运行.bat文件没有一个终端(剩余开)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!