+ Post New Thread
Results 1 to 8 of 8
Windows Thread, Logon script to open webpage in Technical; Hi Guys, I have a simple script to open a webpage when users logon. This is it: Option Explicit Dim ...
  1. #1
    rob998's Avatar
    Join Date
    Jun 2005
    Posts
    125
    Thank Post
    32
    Thanked 21 Times in 7 Posts
    Rep Power
    23

    Logon script to open webpage

    Hi Guys,

    I have a simple script to open a webpage when users logon. This is it:

    Option Explicit

    Dim wshShell

    Set wshShell = WScript.CreateObject("WScript.Shell")

    wshShell.Run ("http://www.website.com")

    The trouble is it opens but when the icons appear on the desktop it closes.

    So my question is how do I stop it closing?

    Thanks

    Rob

  2. #2


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,710
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    You could do something like this...

    Code:
    Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
    
    objExplorer.Navigate "http://www.google.co.uk/"   
    objExplorer.ToolBar = 0
    objExplorer.StatusBar = 0
    objExplorer.Width = 800
    objExplorer.Height = 600 
    objExplorer.Left = 0
    objExplorer.Top = 0
    objExplorer.Visible = 1

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,680
    Thank Post
    3,210
    Thanked 1,030 Times in 955 Posts
    Rep Power
    361
    Quote Originally Posted by Arthur View Post
    You could do something like this...

    Code:
    Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
    
    objExplorer.Navigate "http://www.google.co.uk/"   
    objExplorer.ToolBar = 0
    objExplorer.StatusBar = 0
    objExplorer.Width = 800
    objExplorer.Height = 600 
    objExplorer.Left = 0
    objExplorer.Top = 0
    objExplorer.Visible = 1
    The above is most likely the official way but I have done it in the past using the shell object either run or exec and the explorer process ie

    wshshell.run "explorer.exe http://www.google.co.uk"

    I think you can use vbMaximise or vbNormal or w/e but not sure

  4. #4


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,710
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    There are lots of different ways of doing this. I suppose it depends on what you are trying to achieve.

    Here is another method I sometimes use...

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

  5. #5

    Join Date
    Oct 2007
    Location
    Cambridgeshire, UK
    Posts
    306
    Thank Post
    58
    Thanked 23 Times in 20 Posts
    Rep Power
    17
    I have also done this via GPO. I forget exactly which policy and can't check at present but basically I set iexplorer.exe to run at login and open the specified site.

  6. #6
    wagnerk's Avatar
    Join Date
    Jun 2007
    Location
    Northants
    Posts
    801
    Thank Post
    63
    Thanked 165 Times in 134 Posts
    Rep Power
    46
    Or you can use a simple .bat file. Eg to open up the webpage http://www.yahoo.com, in the .bat file type this in:

    start iexplore http://www.yahoo.com
    -Ken
    Last edited by wagnerk; 21st August 2010 at 08:15 PM. Reason: formatting

  7. #7
    rob998's Avatar
    Join Date
    Jun 2005
    Posts
    125
    Thank Post
    32
    Thanked 21 Times in 7 Posts
    Rep Power
    23
    Thanks for the suggestions. I will give it a try tomorrow. Just hope that when it opens it says open.

    I will report back.

  8. #8
    clareq's Avatar
    Join Date
    Dec 2005
    Location
    Doncaster
    Posts
    675
    Thank Post
    51
    Thanked 180 Times in 117 Posts
    Rep Power
    85
    Does this need to be only for a specific set of users? If not, can you not just put a shortcut in the computer All Users startup folder?

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 17
    Last Post: 18th June 2010, 12:48 PM
  2. Replies: 4
    Last Post: 4th February 2010, 11:11 AM
  3. Script to check if webpage/Eportal is working?
    By burgemaster in forum Scripts
    Replies: 8
    Last Post: 12th June 2009, 02:06 PM
  4. Logon Script Not on 1 PC
    By karldenton in forum Windows
    Replies: 1
    Last Post: 25th March 2009, 12:05 PM
  5. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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