+ 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
    133
    Thank Post
    34
    Thanked 22 Times in 8 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.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    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,811
    Thank Post
    3,327
    Thanked 1,056 Times in 977 Posts
    Rep Power
    365
    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.403651, -0.515458
    Posts
    9,069
    Thank Post
    232
    Thanked 2,719 Times in 2,007 Posts
    Rep Power
    797
    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
    18
    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
    807
    Thank Post
    64
    Thanked 166 Times in 135 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
    133
    Thank Post
    34
    Thanked 22 Times in 8 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
    732
    Thank Post
    53
    Thanked 189 Times in 125 Posts
    Rep Power
    101
    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
  •