10

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
Jimmy Obonyo Abor
  • 7,335
  • 10
  • 43
  • 71

7 Answers7

8

Try:

start /min "" firefox

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

start /min "" "http://google.com"
Endoro
  • 37,015
  • 8
  • 50
  • 63
2

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.

Zdenek
  • 690
  • 3
  • 14
2

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

using the forward slash?

LaidBach
  • 21
  • 3
2

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

Jimmy Obonyo Abor
  • 7,335
  • 10
  • 43
  • 71
  • Apparently the relationship between NirCmd and FF has changed over the years. For me, using FF 85 on Win10 20H2, this command closed FF and erased all open tabs. What worked for me was nircmd win min process firefox.exe – Ray Woodcock Feb 01 '21 at 23:39
1

The Firefox is quite problematic in this respect. Here is the best work out I was reach with VBScript.

Firefox = """c:\path to\firefox.exe"""
Set oShell = CreateObject("WScript.Shell")
Set oFFox  = oShell.Exec(Firefox)

WScript.Sleep 1000
oShell.AppActivate oFFox.ProcessID

WScript.Sleep 1000
oShell.SendKeys "% (n)" ' minimize (Alt+SpaceBar,n)

WScript.Sleep 10 * 1000 ' wait 10 seconds
'next AppActivate call need Full and Exact title
oShell.AppActivate "Mozilla Firefox Start Page - Mozilla Firefox"

WScript.Sleep 1000
'oShell.SendKeys "% (r)"  ' restore (Alt+SpaceBar,r)
oShell.SendKeys "%{F4}"  ' close (Alt+F4)

P.S. Actually, restore command is redundant (I comment out that line).

Note that I not use oShell.AppActivate oFFox.ProcessID nor yet oFFox.Terminate because after minimize process both not work for me, therefore I use the title for the AppActivate and SendKeys to close the application.

Panayot Karabakalov
  • 3,109
  • 3
  • 19
  • 28
1

Did you have a look at https://tn123.org/mintrayr/ addon? This can minimize firefox to try.

anishsane
  • 20,270
  • 5
  • 40
  • 73
0

try with windowMode.bat:

call windwoMode -title "Mozilla Firefox" -mode minimized

though you'll need to know the starting letters of the window you want to minimize.

npocmaka
  • 55,367
  • 18
  • 148
  • 187