Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A batch file to minimize other applications

How can i have a bat file which opens an application lets call it firefox.exe.how would i call the bat file or any other script ie vbs to minimize the application ie firefox.exe then after lets say a minute or two close it.please mind you the start\min does not work?below is an example /part of my script?please help out?

"C:\Program Files\Mozilla Firefox\firefox.exe"  -tray
like image 772
Jimmy Obonyo Abor Avatar asked Apr 02 '13 19:04

Jimmy Obonyo Abor


People also ask

How do I run a batch file minimized?

/min - switch to run minimized.

How do I close a program with batch?

Type taskkill /IM your-program-name. your-program-extension /T /F and then hit ↵ Enter . Repeat this command for as many programs as you want! When finished, type exit on the last line and hit ↵ Enter .

How do I minimize a window in command prompt?

Switch to the Command Prompt window that you want to minimize, and right-click the minimize button. What is this? This will send the window to the system tray. You will see an EXE icon in the system tray to indicate that it is running.


4 Answers

Try:

start /min "" firefox

.. or (if FireFox is your default browser):

start /min "" "http://google.com"
like image 156
Endoro Avatar answered Nov 10 '22 05:11

Endoro


Have you tried:
start /min C:\Program Files\Mozilla Firefox\firefox.exe

using the forward slash?

like image 34
LaidBach Avatar answered Nov 10 '22 06:11

LaidBach


The proper parameter would be -turbo, but it is long obsolete and probably not functional.

start "path\firefox.exe http://example.com/file.html" /MIN

might work better.

EDIT: Oops, it has already been suggested.

like image 20
Zdenek Avatar answered Nov 10 '22 06:11

Zdenek


here is how i solved the problem using a command line tool known as nircmd,i used the hide parameter to hide the firefox and it acctully works perfectly.see the code example.

START "" "C:\Program Files\Mozilla Firefox\firefox.exe" -P "america" -no-remote http://hakikahost.com error.html
"nircmd.exe" win hide process "firefox.exe"

the link to nircmd ...link

like image 30
Jimmy Obonyo Abor Avatar answered Nov 10 '22 04:11

Jimmy Obonyo Abor