Hide Command Window of .BAT file that Executes Ano

2019-01-13 07:17发布

This is a batch file in Windows.

Here is my .bat file

@echo off
copy "C:\Remoting.config-Training" "C:\Remoting.config"

"C:\ThirdParty.exe"

This works fine except the .bat file leaves the command window open the whole time the "ThirdParty" application is running.
I need the command window to close.

I would use the short-cut for the application but I must be able to run this copy command first (it actually changes which data base and server to use for the application).

The ThirdParty application does not allow the user to change the source of the db or the application server.

We're doing this to allow users to change from a test environment to the production environment.

14条回答
The star\"
2楼-- · 2019-01-13 08:01

You might be interested in trying my silentbatch program, which will run a .bat/.cmd script, suppress creation of the Command Prompt window entirely (so you won't see it appear and then disappear), and optionally log the output to a specified file.

查看更多
走好不送
3楼-- · 2019-01-13 08:02

I haven't really found a good way to do that natively, so I just use a utility called hstart which does it for me. If there's a neater way to do it, that would be nice.

查看更多
登录 后发表回答