+ 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
    140
    Thank Post
    34
    Thanked 22 Times in 8 Posts
    Rep Power
    24

    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,652
    Thank Post
    253
    Thanked 2,917 Times in 2,148 Posts
    Rep Power
    831
    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,995
    Thank Post
    3,539
    Thanked 1,110 Times in 1,016 Posts
    Rep Power
    374
    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,652
    Thank Post
    253
    Thanked 2,917 Times in 2,148 Posts
    Rep Power
    831
    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
    820
    Thank Post
    65
    Thanked 169 Times in 137 Posts
    Rep Power
    48
    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 09:15 PM. Reason: formatting

  7. #7
    rob998's Avatar
    Join Date
    Jun 2005
    Posts
    140
    Thank Post
    34
    Thanked 22 Times in 8 Posts
    Rep Power
    24
    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
    764
    Thank Post
    56
    Thanked 193 Times in 128 Posts
    Rep Power
    102
    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, 01:48 PM
  2. Replies: 4
    Last Post: 4th February 2010, 12:11 PM
  3. Script to check if webpage/Eportal is working?
    By burgemaster in forum Scripts
    Replies: 8
    Last Post: 12th June 2009, 03:06 PM
  4. Logon Script Not on 1 PC
    By karldenton in forum Windows
    Replies: 1
    Last Post: 25th March 2009, 01:05 PM
  5. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 12:00 PM

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
  •