Batch Files and Application Focus

This is a discussion about Batch Files and Application Focus in the Windows Software category; 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.

Windows Software 5498 This topic was started by ,


data/avatar/default/avatar14.webp

507 Posts
Location -
Joined 2000-01-30
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

Participate in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.
Jan 1
Created
Mar 27
Last Response
0
Likes
2 minutes
Read Time
User User User
Users

Responses to this topic


data/avatar/default/avatar27.webp

1117 Posts
Location -
Joined 2000-01-23
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.

data/avatar/default/avatar14.webp

507 Posts
Location -
Joined 2000-01-30
OP
Excellent!
 
Thank you very much!
 
ARC

data/avatar/default/avatar05.webp

1 Posts
Location -
Joined 2011-03-27
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