3

Currently I am using this vbs script during logon to a Windows desktop:

Set oIE       = CreateObject("InternetExplorer.Application")  ' This creates a Internet Explorer window
oIE.Left      = -5000                                         ' This allows the page to initilize off-screen
oIE.Top       = -5000                                                 ' This allows the page to initilize off-screen
oIE.navigate "http://myurl/?popup=1"                      ' This is URI
oIE.ToolBar   = 0                                                     ' This removes the toolbar
oIE.StatusBar = 1                                                     ' This removes the status bar
oIE.Resizable = 1                                                     ' This allows the maximise button
oIE.Visible   = 1   

That is run from the users logon batch file.

I've been asked to add another one and I dislike this approach but don;t know how else to achieve it?

Thanks

Further Detail

The situation is that it will need to be run for only certain users in Active Directory - hopefully they will be in specific OU's and if they are not then I'll put them there! So my approach has been from a Logon Script applied to Groups angle - I didn't want to use the StartUp folder or the registry so that the users that have the screen popped up can easily be managed though Active Directory. Hope that makes more sense!

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
David A Gibson
  • 163
  • 3
  • 7
  • You seem to be asking two separate questions. The title asks about launching the default browser, but the question text (or at least your current solution) launches IE specifically. Which do you want? – jalf Apr 30 '09 at 12:30
  • @MrBrutal, why don't you update your question with the comment you gave to joshhunt – Alex Angas May 07 '09 at 08:51
  • Any particular reason for this? (that isn't covered by forcing a specific home page that will be displayed when the user feels like starting a browser - or by a custom hta file showing whatever internal information is needed?) – Oskar Duveborn May 07 '09 at 11:03
  • Good point Alex - done! – David A Gibson May 07 '09 at 11:20

4 Answers4

3

ShellExecute the URL.

Richard Gadsden
  • 3,686
  • 4
  • 29
  • 58
2

If it is only for yourself, or you are not worried about users removing it, you could just create a shortcut to the website on the desktop like any other shortcut then move the shortcut to the start menu in All Program > Startup. For all users just drop it in \Documents and Settings\All Users\Start Menu\Programs\Startup, or for a specific user drop it in \Documents and Settings\DESIRED USER\Start Menu\Programs\Startup, taking care to replace DESIRED USER with, well, the desired user.

Alternatively, you could put the shortcut in a 'secret' such as \WINDOWS and create an entry in the registry at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run for the current logged user, or under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run for all users. The name should be a short description of the shortcut, and the value should be where the shortcut resides on the system, appended with .url (e.g. if i saved a shortcut to Google in the windows folder, and named the shortcut google, the value would be "C:\WINDOWS\google.url"

Josh Hunt
  • 570
  • 8
  • 12
  • The situation is that it will need to be run for only certain users in Active Directory - hopefully they will be in specific OU's and if they are not then I'll put them there! So my approach has been from a Logon Script applied to Groups angle - I didn't want to use the StartUp folder or the registry so that the users that have the screen popped up can easily be managed though Active Directory. Hope that makes more sense! – David A Gibson May 07 '09 at 08:09
1

Run the command "start http://your-url", perhaps?

(This has much the same effect as Richard Gadsden's solution, wnoch seems fine to me)

It would help to know what you dislike about your current solution, though.

  • Yeah, sorry I wasn't very clear - I have had this on my mind for a while and just jumped straight in when the beta occurred. I've added more detail to joshunts answer comments. – David A Gibson May 07 '09 at 08:11
0

Rather than using Internet Explorer, you might want to run the URL in default browser. So run:

Dim WshShell 
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "cmd /c start "" ""URL"""
Wasif
  • 321
  • 2
  • 8