Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript Seems to Require Admin Rights to Work

Status
Not open for further replies.

CCHall

IS-IT--Management
May 3, 2005
46
US
This script works perfectly if an admin user is logged in, but with a standard user, rather than opening multiple URLs in separate tabs in IE like it's supposed to, it opens the first (main) URL multiple times, and ignores the other URLs. Any advice would be greatly appreciated!


main = "wwatty = "wwcourse = "wwattd = "inscse = "
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
'open a new window
'open IE maximized
oIE.Left = 0
oIE.Top = 0
oIE.TheaterMode = True
iHeight = oIE.Height
iWidth = oIE.Width
oIE.TheaterMode = False
oIE.Height = iHeight
oIE.Width = iWidth
oIE.Navigate2 main
'open url In new tab
oIE.Navigate2 wwatty, 2048
oIE.Navigate2 wwcourse, 2048
oIE.Navigate2 wwattd, 2048
oIE.Navigate2 inscse, 2048
oIE.Visible = True
Set oIE = Nothing
 
I use the format:

oIE.Navigate2 " navOpenInBackgroundTab

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thanks for the reply. I've tried it this way as well and have the same problem - it works fine for admin users but for non-admin users, brings up the first tab multiple times rather than the referenced sites in their own tabs.

CC
 
Are you running the script as a login script via a GPO?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
No, just running the script straight from Windows, the old fashioned way, by double clicking the VBS file.

Thanks!
CC
 
Use this wrapper code to have your script run elevated.

Code:
[green]
'This code looks for an argument (can be bogus).  
'If no argument then the script is automatically relaunched elevated as admin.[/green]

If WScript.Arguments.length = 0 Then
  Set objShell = CreateObject("Shell.Application")
  objShell.ShellExecute "wscript.exe", Chr(34) & _
  WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
Else
  [green]'Add your code here[/green]
End If

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top