开发者

How to create a .BAT file opening program and preventing it from opening new windows?

开发者 https://www.devze.com 2022-12-31 01:34 出处:网络
So I am starting a consol program from .bat file. I want it to run as a pr开发者_开发技巧ocess but not showing any windows. How to do such thing? I think the start command with a \'/B\' option should

So I am starting a consol program from .bat file. I want it to run as a pr开发者_开发技巧ocess but not showing any windows. How to do such thing?


I think the start command with a '/B' option should do it ...

Windowless:

@echo off
start /B Myapp.exe

Minimized:

@echo off
start /MIN Myapp.exe


I'm not sure if I understand what you mean: if you run a console program from a .bat/.cmd script, that program will use the existing console window, not create a new one.

I suspect what you're really asking is how to prevent Explorer from opening a console window for the .bat/.cmd script itself. There's no built-in way to do that (although as amir75 suggested, you can mitigate it by running the script minimized; instead of running the script directly, create a shortcut to it and edit the shortcut's properties).

Alternatively, you can run your script through the silentbatch program that Paul Miner and I wrote.

0

精彩评论

暂无评论...
验证码 换一张
取 消