Batch Files and Application Focus
Hi Guys, I am using Batch file to call another program with some parameters and stuff. When I do this, it shows the ugly dos window and my program executes properly. The DOS window doesn't go away until my program is finished and it looks very ugly.
Hi Guys,
I am using Batch file to call another program with some parameters and stuff.
When I do this, it shows the ugly dos window and my program executes properly. The DOS window doesn't go away until my program is finished and it looks very ugly. Is there a way it could automatically minimize to taskbar or doesnt show up. I mean only my pgoram runs up and the dos window run in background.
Let me know.
Thanks
I am using Batch file to call another program with some parameters and stuff.
When I do this, it shows the ugly dos window and my program executes properly. The DOS window doesn't go away until my program is finished and it looks very ugly. Is there a way it could automatically minimize to taskbar or doesnt show up. I mean only my pgoram runs up and the dos window run in background.
Let me know.
Thanks
Participate on our website and join the conversation
This topic is archived. New comments cannot be posted and votes cannot be cast.
Responses to this topic
Well, you could just make a shortcut to the program, and add the paramaters to the 'target' line. If you can do what you need this way, it will be the easiest.
If you still want to do it in a batch file, use the "start" command. Your line will read "start program parameters". Obviously, replace program and parameters with your settings. The batch file will still pop up a shell window, but it won't wait for the program to finish before it finishes the batch file.
Yet another way is through scripting, in a .vbs file. You can start programs using the Run method, as described here. Scripts are completely transparant when they run.
If you still want to do it in a batch file, use the "start" command. Your line will read "start program parameters". Obviously, replace program and parameters with your settings. The batch file will still pop up a shell window, but it won't wait for the program to finish before it finishes the batch file.
Yet another way is through scripting, in a .vbs file. You can start programs using the Run method, as described here. Scripts are completely transparant when they run.
You can use this in Bach file
@echo off
if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized
Start /B /I drive:\path\filename.exe
exit
or download and use a small program called [cmdow], but be careful anti-virus programs might report it as virus or spy
@echo off
if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized
Start /B /I drive:\path\filename.exe
exit
or download and use a small program called [cmdow], but be careful anti-virus programs might report it as virus or spy