Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening a menuless browser window

    Hi all,

    I'm looking for a way of opening a full-size menu-less browser window (similar to a pop-up window, but maximised if possible) from a desktop link (I have found many javascript methods of opening a new pop-up window from an existing 'standard' IE window, but I need this to open from scratch).

    The PC in question will not be online - the purpose of this project is to open a 'help' style html mini-site which will be based locally on the hard drive.

    I have tried using the following code as a .vbs file (as sourced elsewhere on this site), and it pretty much does what I want (and has the advantage of not triggering the IE java alert) but it seems to struggle with opening a local link instead of an http:// link.

    Set objExplorer = CreateObject("InternetExplorer.Application")
    objExplorer.Navigate "http://www.google.ie"
    objExplorer.ToolBar = 0
    objExplorer.StatusBar = 0
    objExplorer.Width = 1024
    objExplorer.Height = 768
    objExplorer.Left = 0
    objExplorer.Top = 0
    objExplorer.Visible = 1


    I'm open to all suggestions as to how this could be accomplished!!

  2. #2
    Super Moderator
    Join Date
    Jun 2011
    Location
    New England
    Posts
    4,745
    Thanks
    171
    Thanked 648 Times in 571 Posts
    Tried "file://" before the drive/path/filename?

    Bruce

  3. #3
    New Lounger
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the response Bruce. There's no problem with pointing the link to a local file, and the local file will open in a browser window, however the window doesn't open as a simple pop-up, and an unknown coding problem is flagged. As I say, it functions perfectly when an http:// link is used.

    Just re-read my initial post - apologies for not being more precise about the nature of the problem .

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,162
    Thanks
    47
    Thanked 976 Times in 906 Posts
    This should do the trick. You need to turn everything off to make it work.

    Code:
    Set objArgs = WScript.Arguments 
    If objArgs.Count = 0 Then 
    	WScript.Echo "No URL provided, please supply a URL to open" & VbCrLf & VbCrLf & "e.g. CScript OpenURL.vbs http://www.google.com" 
    	wscript.quit
    End If 
    
    Set objIE = CreateObject("InternetExplorer.Application") 
    
    With CreateObject("internetexplorer.application") 
       .navigate "about:blank" 
       With .document.parentWindow.screen 
         iHeight = .height 
         iWidth = .width 
       End With 
    End With 
    
    objIE.StatusBar = False 
    objIE.Visible = True 
    objIE.AddressBar = False 
    objIE.MenuBar = False 
    objIE.ToolBar = False 
    objIE.Top = 0 
    objIE.Left = 0 
    objIE.Width = iWidth 
    objIE.Height = iHeight - 28 'Shrink a bit to see the taskbar
    objIE.Navigate (objArgs(0))
    cheers, Paul
    Last edited by Paul T; 2012-10-23 at 12:31.

  5. #5
    New Lounger
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That would be great thanks Paul :-)

  6. #6
    New Lounger
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Paul,

    Many thanks for posting the code :-)

    I'm more used to working with html than other coding, so apologies if the following questions are a bit dumb, but:
    1) Should I just save your code as a .vbs file?
    2) Where exactly should I enter my local file pathway? (I have tried adding it in different places but keep getting the "No URL provided..." dialogue)
    3) When you say I need to turn everything off, what exactly do you mean?

    Thanks again,
    Mike.

  7. #7
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,162
    Thanks
    47
    Thanked 976 Times in 906 Posts
    Save the file as OpenURL.vbs.
    Call it direct or with cscript and supply the URL at the end.
    e.g. OpenURL.vbs htp://www.google.com

    Turn off the various IE bits, like AddressBar.

    If you want to hard coed the URL remove the first 5 lines and add URL in the "navigate" line, like your original post.

    cheers, Paul

  8. #8
    New Lounger
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a million for all the help Paul - it took a few false starts but its now working exactly as intended :-) :-)

    Mike.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •