how to use bat file to open serveral html files wiht one instance of ie8

Discussion in 'Internet Explorer' started by GS, Jun 28, 2010.

  1. GS

    GS Guest

    when I tried on ie8 with bat file like
    "<<i8dir>>iexplore" h1.html
    "<<i8dir>>iexplore" h2.html
    "<<i8dir>>iexplore" h3.html

    they all opened in one single tab not in multiple tabs
    what is the correct way to do this.

    I am getting tired of manually opening a number of test html files for my
    app development and test
     
    GS, Jun 28, 2010
    #1
    1. Advertisements

  2. PA Bear [MS MVP], Jun 28, 2010
    #2
    1. Advertisements

  3. GS

    Rob Guest

    Tip: When sending someone away to another place, make sure it actually
    does exist.
    Tip: when pasting a canned reply, make sure it is relevant to the question.
     
    Rob, Jun 28, 2010
    #3
  4. GS

    GS Guest

    found out I can use vbs script.


    Dim ie
    set ie = CreateObject("InternetExplorer.Application") 'InternetExplorer

    ie.navigate(file1.html)
    ie.navigate( file2.html, 2048)
    ....

    the key to new tab is the extra argument value 2048.

    now it's a cinch
    as for bat file, I could not and have not found a way
     
    GS, Jun 28, 2010
    #4
  5. We shall alert the media.
     
    PA Bear [MS MVP], Jun 28, 2010
    #5

  6. If you made those Favorites (pointed to by .url files) you could try this
    (e.g. from the directory where you kept them):

    for %u in (*.URL) do "%u"


    I have been meaning to figure out how to use PowerShell instead of a cmd
    window. ; )


    Good luck

    Robert Aldwinckle
    ---
     
    Robert Aldwinckle, Jun 29, 2010
    #6
  7. Do you simply add 1024 to the 2048 to make new tabs for additional files?

    2048 for a tab, 3072 for the next, 4096 for the next, and so on?
     
    Jeff Strickland, Jun 29, 2010
    #7
  8. GS

    GS Guest

    thx
    what is difference of using url instead of
    "<<ie8dir>>\iexplorer" f1.html
    cd /d d:\mytestDataFolder
    for %i in (test*.html) do %i
     
    GS, Jun 29, 2010
    #8
  9. GS

    GS Guest

    no, 2048 means use a new tab for the navigate instead of using the currently
    active tab when you don't specify the 2nd argument

    Note the vbscript will stop the moment it navigates to a file or site with
    disallowed script/activeX even if you have the ignore all
    On Error Resume Next
     
    GS, Jun 29, 2010
    #9

  10. I don't know. Does it do what you want too?...

    <cmd_output OS="W7 X64">

    C:\>assoc .html
    ..html=htmlfile

    C:\>ftype htmlfile
    htmlfile="C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE" -nohome

    C:\>assoc .url
    ..url=InternetShortcut

    C:\>ftype InternetShortcut
    InternetShortcut="C:\Windows\System32\rundll32.exe"
    "C:\Windows\System32\ieframe.dll",OpenURL %l

    </cmd_output>

    E.g., you might have to find the right combination of options to make sure
    that you didn't open multiple windows, even if they were being started under
    the same base iexplore.exe task. FWIW the one I suggested works for me but
    for all I know that may only be because of my popup options or something.


    Robert
    ---
     
    Robert Aldwinckle, Jun 29, 2010
    #10
  11. So, the vb script would look something like
    navigate(file1,2048)
    navigate(file2,2048)
    navigate(file3,2048)
    navigate(file4,2048)

    and so on, to open several single files in separate tabs running in the same
    instance of ie?
     
    Jeff Strickland, Jun 29, 2010
    #11
  12. GS

    GS Guest

    almost. the first file do not need the 2048 argument unless you want the
    original about:blank or whatever active tab left alone
     
    GS, Jun 30, 2010
    #12
  13. GS

    GS Guest

    it does what I want only if I had a line like this
    explorer about:blank
    somewhere before the FOR statement.


    It does have about:blank as first tab but I can live with that.
    the batch file no longer gets bothered by IE's restriction active content.
    the batch file just keeps loading w/o skipping any file

    works even when the FOR list includes fully qualified files in other
    directory if the path does not contain blank nor special characters
     
    GS, Jun 30, 2010
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.