VB Script to set home page on 2k8 Terminal Server

Having trouble with a vbs script to set the homepages on my user's desktops.  On WinXP machines it works perfectly, however on my 2008 x64 Terminal Server farm when the script runs it gives me.....

Line:  5
Char:  1
Error:  Invalid root in registry key "HKLM\software\Microsoft\Internet Explorer\Main\Start Page"
Code:  80070005
Source:  WshShell.Regwrite

Here's the body of the script....


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

' home page URL
StartPage = "http://intranet.companyweb.com"
WSHShell.RegWrite "HKLM\Software\Microsoft\Internet Explorer\Main\Start Page", StartPage
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", StartPage


sorry I'm not that great with vbscripting but need to get this to work to get the sharepoint site set for the homepage globally in the environment.

Any help would be appreciated
clamastersAsked:
Who is Participating?
 
NJComputerNetworksCommented:
oh... I think the registry location might be different on 64 bit...I will check.. be back shortly.
0
 
NJComputerNetworksCommented:
why not use GPO for this?
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
clamastersAuthor Commented:
I tried using a GPO actually and for some users it was working as intended, both on the XP machines and the TS sessions, however there were a LOT of machines where the settings refused to take.  In addition the gpo also decided that it wouldn't let anyone set a different homepage so I couldn't even manually set it.  So I killed the Internet Explorer Maintenance settings and setup this script to do the same thing.
0
 
NJComputerNetworksCommented:
0
 
clamastersAuthor Commented:
possibly by default but they all have IE 8 on them currently
0
 
NJComputerNetworksCommented:
an end user, will probably not have rights to modify the registry under thier credentials... so this problaby won't work unless you run this as administrator:

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

' home page URL
StartPage = "http://intranet.companyweb.com"
WSHShell.RegWrite "HKLM\Software\Microsoft\Internet Explorer\Main\Start Page", StartPage
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", StartPage

I found a similar script online, that modifies only the HKCU (If you still want to go the script route)
http://www.codeproject.com/KB/vbscript/vbscripthomepage.aspx
0
 
NJComputerNetworksCommented:
oh... and you might want to include this line in your scritp:

On Error Resume Next


This tells the script to continue...even if an error happens... in this way, the rest of your script will run..
0
 
clamastersAuthor Commented:
Trust me I'd love to go the gpo route and would definitely prefer that.  I just for the life of me can't figure out what's blocking the settings from taking hold.  There's a TS Policy in place but the only settings there for Internet Explorer are thw follow, and I can't see how this would be blocking the new home page settings....

Windows settings
     Internet Explorer Maintenance
          Browser User Interface/Customized Title Bar
               Title Bar Text

0
 
clamastersAuthor Commented:
well apparently there was something in the TS policy blocking it.... added the home page to that gpo and it's starting to work with my test accounts.... too weird.....
0
All Courses

From novice to tech pro — start learning today.