vbs script to open firefox with height and width set

Posted on 2005-04-29
Last Modified: 2010-07-16
What is the .vbs script to open a firefox window with parameters such as width, height,
position, etc? I have xp and firefox 1.03 installed.
Question by:steve44
    LVL 11

    Assisted Solution


    You can start the firefox using "<Drive>:\Program Files\Mozilla Firefox\firefox.exe" but you can't handle the height and with on code...

    LVL 29

    Assisted Solution

    You can do this is visual basics, but in a vbscript I am not sure.
    LVL 2

    Accepted Solution

    You can set the size of a browser window with a javascript bookmark (instead of using a URL), this is of course assuming that javascript is enabled.

    This works for me in FireFox 1.02, Windows XP:  

    Unfortunately this does open a new tab, which may not be what you want.

    I can also enter either of these in "Start" -> "Run" to open it with the bookmark:
      "c:\Program Files\Mozilla Firefox\firefox.exe" javascript:resizeTo(640,480)
      "firefox.exe" javascript:resizeTo(640,480)

    NB: if you already have a Firefox open already, it opens a new tab in that instance.

    The alternative would be to shell Firefox and store the process ID that Shell returns, then use a few API calls (I'm not sure that VBScript supports them) to find and size the window.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now