none
VBScript with Internet Explorer RRS feed

  • Question

  • Here is a script to launch IE via vbScript.

    Set objExplorer = CreateObject("InternetExplorer.Application")
    objExplorer.Navigate "http://www.google.com"
    objExplorer.ToolBar = 0
    objExplorer.StatusBar = 1

    Can anyone help to revise the above script with the following:

    Set WshShell = WScript.CreateObject("WScript.Shell") 
    Return = WshShell.Run("iexplore.exe http://www.google.com", 1) 

    By the way, is it possible to stop the IE shortcut feature with script? (i.e Ctrl-N..)

    Regards,


    JohnnyW2012

    Tuesday, May 20, 2014 9:24 AM

Answers

  • Creating the IE object is the only way you're going to be able to control the application the way you're asking, using the shell method just starts the process - you can't tap into the application behavior that way.  Not sure about disabling the shortcuts, I can't seem to find anything useful unless you include code in the target page that handles keydown events.

    I hope this post has helped!

    • Marked as answer by JohnnyW2012 Wednesday, May 21, 2014 1:03 AM
    Tuesday, May 20, 2014 4:56 PM
  • If all you need is Internet Explorer on these kiosks, try this:

    GPO --> User Configuration --> Administrative Templates --> System --> Custom User Interface --> set to "iexplore.exe -k <pageURL>"

    What this does, instead of running explorer.exe, and getting the start menu and taskbar, you instead get Internet Explorer as the UI.

    Hope this helps.

    (EDIT: More about the kiosk mode (the -k option): http://support.microsoft.com/kb/154780)


    I hope this post has helped!

    • Marked as answer by JohnnyW2012 Wednesday, May 21, 2014 1:03 AM
    Tuesday, May 20, 2014 6:29 PM

All replies

  • Your first script opens IE by using the Internet Explorer object.
    The second script opens IE by shelling out and launching iexplore.exe.
    You either use one script or the other. What exactly do you mean with "revise the script"?
    Tuesday, May 20, 2014 10:46 AM
  • Yes, I can launch the IE with

    Set WshShell = WScript.CreateObject("WScript.Shell") 
    Return = WshShell.Run("iexplore.exe http://www.google.com", 1) 

    The question is how to include the following script to be part of it. (because objExplorer is no longer used here). 

    objExplorer.ToolBar = 0
    objExplorer.StatusBar = 1

    another question is "is it possible to stop the IE shortcut feature with script? (i.e Ctrl-N..)"

    Thanks,



    JohnnyW2012

    Tuesday, May 20, 2014 4:36 PM
  • 1) You can't, unless you know of some way to pass these options in on the command line.

    2) I don't believe it is possible to remove the ability to launch a new IE window via script.


    Don't retire TechNet! - (Don't give up yet - 12,830+ strong and growing)

    Tuesday, May 20, 2014 4:42 PM
  • Creating the IE object is the only way you're going to be able to control the application the way you're asking, using the shell method just starts the process - you can't tap into the application behavior that way.  Not sure about disabling the shortcuts, I can't seem to find anything useful unless you include code in the target page that handles keydown events.

    I hope this post has helped!

    • Marked as answer by JohnnyW2012 Wednesday, May 21, 2014 1:03 AM
    Tuesday, May 20, 2014 4:56 PM
  • Thank you both for quick reply. I don't know much vbscript but I'm using the following script to launch IE as Kiosk alike in Citrix 4.5/2003R2 environment. But it does not work properly in 2008R2/Citrix 6.5. Here is article explaining why.

    http://support.citrix.com/article/CTX139195

    Set objExplorer = CreateObject("InternetExplorer.Application")

    '* current script
    objExplorer.Navigate "http://www.google.com"
    objExplorer.ToolBar = 0
    objExplorer.StatusBar = 1
    objExplorer.Left = 0
    objExplorer.Top = 0
    objExplorer.Visible = 1

    I'm trying to figure out if it's possible to continue using vbscript with this new change (per article).

    Thanks,

    JohnnyW2012

    Tuesday, May 20, 2014 5:38 PM
  • If all you need is Internet Explorer on these kiosks, try this:

    GPO --> User Configuration --> Administrative Templates --> System --> Custom User Interface --> set to "iexplore.exe -k <pageURL>"

    What this does, instead of running explorer.exe, and getting the start menu and taskbar, you instead get Internet Explorer as the UI.

    Hope this helps.

    (EDIT: More about the kiosk mode (the -k option): http://support.microsoft.com/kb/154780)


    I hope this post has helped!

    • Marked as answer by JohnnyW2012 Wednesday, May 21, 2014 1:03 AM
    Tuesday, May 20, 2014 6:29 PM
  • Thanks for the help. Yes, I know about the -k switch but trying to avoid that for PC users. 

    Thanks again. 


    JohnnyW2012

    Wednesday, May 21, 2014 1:03 AM