A batch file to minimize other applications

20,616

Solution 1

Try:

start /min "" firefox

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

start /min "" "http://google.com"

Solution 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

Solution 3

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.

Solution 4

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

using the forward slash?

Solution 5

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

Share:
20,616
Jimmy Obonyo Abor
Author by

Jimmy Obonyo Abor

Full stack web/mobile developer, cloud solutions architect. I am vastly experienced in server/web/mobile/cloud/containerization technologies, conversant with functional and object oriented methodologies , test driven programming, ci/cd technologies and processes. Worked on singular and team settings, able to thrive in a fast-paced environment, looking to create world-class applications. Am passionate about programming, loves to learn, enjoys the challenge and artistry inherent in the creation process. Can do attitude, reliable, self starter. My favorite stacks are Nodejs, Python, Go-lang,Meteor, React,React Native,Vue, Laravel (Php) , Jest, Mocha.

Updated on March 11, 2020

Comments

  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 4 years

    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
    Jimmy Obonyo Abor about 11 years
    funny enough your code minimizes the cmd prompt but not the firfox?
  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 11 years
    it opens the url in a new window which does not minimize ,and it opens with a default window.not what am loking for!
  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 11 years
    opens firefox ,but does not minimize the firefox window!
  • Ansgar Wiechers
    Ansgar Wiechers about 11 years
    Why do you use SendKeys to restore and close a window when you already have a WshScriptExec object that you can simply Terminate?
  • Panayot Karabakalov
    Panayot Karabakalov about 11 years
    @AnsgarWiechers - Only because that not work for me, see my update.
  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 11 years
    what platform are you using?am using windows xp,and doesnt seem to work?
  • anishsane
    anishsane about 11 years
    The addon adds a minimize to tray feature to firefox.
  • Endoro
    Endoro about 11 years
    also xp, both are working, but not, if FireFox is already open.
  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 11 years
    ok thanks!guess there is something wrong machine,coz it doesnt minimize whichever way,will try in another machine.did the firefox tray parameter work?
  • anishsane
    anishsane about 11 years
    Oh... that addon has an option, to "always start minimized". In case it is ok with you.
  • anishsane
    anishsane about 11 years
    oh wait... I think, it was some other addon, with similar functionality... But google for "firefox minimize to tray" :)
  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 11 years
    does this command line work from your end "C:\Program Files\Mozilla Firefox\firefox.exe" -tray using the -tray parameter?pliz reply
  • anishsane
    anishsane about 11 years
    nopes... FF doesn't support this option.. See this: kb.mozillazine.org/Command_line_arguments
  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 11 years
    does using the firefox tray parameter work from your end?pliz reply?
  • Endoro
    Endoro about 11 years
    no, it doesn't. there is no /tray option in the start command. Minimize to tray is in the responsibility of a windows application, not of cmd.
  • Jimmy Obonyo Abor
    Jimmy Obonyo Abor about 11 years
    no the tray is a ff commandline parameter see the link kb.mozillazine.org/Command_line_arguments but it doesnt seem to work!
  • Panayot Karabakalov
    Panayot Karabakalov about 11 years
    Perhaps this works on concrete case? I'm too on XP and this not work. My Firefox is 3.5.2 portable (if that relevant).
  • Ansgar Wiechers
    Ansgar Wiechers about 11 years
    Hmm... both works just fine for me. I tested with SeaMonkey, not Firefox, though.
  • Panayot Karabakalov
    Panayot Karabakalov about 11 years
    @AnsgarWiechers - Can you test unruly Firefox as well.
  • Ansgar Wiechers
    Ansgar Wiechers about 11 years
    Works with Firefox 20.0 as well (fresh install on Server 2003).
  • anishsane
    anishsane over 10 years
    Change Program Files & Mozilla Firefox to 8.3 notation, to avoid space in the path. Or see Endoro's answer.
  • Ray Woodcock
    Ray Woodcock over 3 years
    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