start IE with no menu/address bar through command line in Windows

14,820

Solution 1

The best way to do it with .net is by console application with reference to the COM object of IE.

Instructions:

Create new console application in VS and reference to the Microsoft Internet Controls (SHDocVw) type library.

Example in c#:

SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
ie.Navigate(url);
ie.ToolBar = 0;
ie.AddressBar = false;
ie.Visible = true;

see more details at msdn: http://msdn.microsoft.com/en-us/library/aa752084(v=vs.85).aspx

Solution 2

create a small .net application with embed browser control in it, like a windows form with embedded Internet component on it.

check this out form more information## Heading ##

http://technet.microsoft.com/en-us/library/cc977534.aspx

Solution 3

var ie = new ActiveXObject("InternetExplorer.Application");
ie.Navigate("C:\\sample.htm");
ie.AddressBar = false;
ie.MenuBar = false;
ie.ToolBar = false;
// ... etc ... customize your heart out
ie.Visible = true;
Share:
14,820
Stefan
Author by

Stefan

Single tier programmer for multi tier apps.

Updated on August 07, 2022

Comments

  • Stefan
    Stefan almost 2 years

    Is there a way to start IE with a bare window (not kiosk mode, needs to have the close button) through a command line option?

    We have some pages in an internal web-app that needs alot of screen realestate and we only need the HMTL rendering of the browser not the other stuff.

    I found http://www.quero.at/launcher.php but the last update is 5 years old.

    How to remove IE toolbar and menu bar Similar question but no answer.

  • Stefan
    Stefan over 12 years
    Edited my question, the app in question is a web-app. What we want is as much screen estate as possible when users use the web-app. Unfortunately thousands of our PCs still run on old CRTs with 1024x800
  • Stefan
    Stefan over 12 years
    Do you know if such an app already exists? I found one (see link in question) but it seems outdated.
  • Stefan
    Stefan over 12 years
    Is there any way to do this command line or do i have to write a separate app for that?
  • Raymond Chen
    Raymond Chen over 12 years
    Put the program in a file called, say, "OpenInIE.js" and then run it from the command line as cscript OpenInIE.js.
  • dmarietta
    dmarietta over 12 years
    If it is a web app, then you are basically limited to what can be accomplished with the window.open method in javascript, specifically the optional parameters. Refer to: htmlgoodies.com/beyond/javascript/article.php/3471221/…
  • Raymond Chen
    Raymond Chen over 12 years
    StackOverflow is for programming questions, so if you're not interesting in programming, you probably should ask on superuser instead.
  • Stefan
    Stefan over 12 years
    @Raymond Chen From the Faq: software tools commonly used by programmers. I use IE all the time because i write and test my web-apps for IE. So i would say my question is legitimate on Stackoverflow. Just like i can ask Eclipse questions here.
  • Raymond Chen
    Raymond Chen over 12 years
    Eclipse is an IDE. People ask Visual Studio questions too. But your question is more about asking about command line options for a program, which is more of a superuser thing.
  • Serj Sagan
    Serj Sagan over 11 years
    Here is a better tutorial on using the Web Browser control... it really is one of the best ways to do it... dotnetperls.com/webbrowser