Page 1 of 1 1
Topic Options
#205544 - 2012-08-08 05:49 PM Set Home Page and Other tabs
ChipHead Offline
Just in Town

Registered: 2012-07-24
Posts: 1
Loc: Wyoming, U.S.A.
I am trying to set a Home Page for all my users and other secondary tabs as well, but it's not working.... I get the home page, but no secondaries. Would appreciate it if anyone can help.....

This is the script fragment:
 Code:
;Begin SharePoint News Page Settings
;If InGroup("LPNT\RMHO_SHP_HOMEPAGE")
If InGroup("RMHOInetAccess")
	$IEMain = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main"
	$SHPPage = "http://sharepoint.lpnt.corpad.net"
	$HomePage = ReadValue($IEMain, "Start Page")
		If($HomePage <> $SHPPage)
		$SecondaryHP = "http://www.google.com" 
		$SecondaryHP = ReadValue($IEMain, "Secondary Start Pages")
			If(WriteValue($IEMain, "Start Page", $SHPPage, "REG_SZ") And WriteValue($IEMain, "Secondary Start Pages", $HomePage + "|" + $SecondaryHP, "REG_MULTI_SZ"))
			$WriteShpProcessed = WriteValue($IEMain, "SharePoint Deployed", "Deployed", "REG_SZ")
			EndIf
		EndIf
EndIf
;End SharePoint News Page Settings


Edited by Mart (2012-08-09 09:26 AM)
Edit Reason: Added code tags.

Top
#205545 - 2012-08-08 08:19 PM Re: Set Home Page and Other tabs [Re: ChipHead]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2115
Loc: Tulsa, OK
This seems to work just fine for me...

 Code:
;Begin SharePoint News Page Settings
;If InGroup("LPNT\RMHO_SHP_HOMEPAGE")
If InGroup("RMHOInetAccess")
   $IEMain = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main"
   $SHPPage = "http://sharepoint.lpnt.corpad.net"
   $CurrentStartPage = ReadValue($IEMain,"Start Page")
   If $CurrentStartPage <> $SHPPage
      $SecondaryStartPages = $CurrentStartPage+"|"+ReadValue($IEMain, "Secondary Start Pages")
      If WriteValue($IEMain,"Start Page",$SHPPage,"REG_SZ") = 0 AND WriteValue($IEMain,"Secondary Start Pages",$SecondaryStartPages,"REG_MULTI_SZ") = 0
         $nul = WriteValue($IEMain,"SharePoint Deployed","Deployed","REG_SZ")
      EndIf
   EndIf
Endif
;Endif
;End SharePoint News Page Settings

Maybe those extra ()'s on all your IF statements were causing problems. Not sure I changed anything else really. Oh I removed the extra $SecondaryHP= line...No point in setting it to Google.com if you are going to immediately set it to the registry read on the next line. Also changed variable names to make it easier to follow...mostly for my own accord.


Edited by ShaneEP (2012-08-08 08:34 PM)

Top
#205546 - 2012-08-08 10:21 PM Re: Set Home Page and Other tabs [Re: ChipHead]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4367
Loc: New Jersey
Welcome to KORG!

When you post your script, enclose it in "code tags" to make it easier to read. Similar to HTML, but using square brackets - "[" and "]" - instead. Like this:
[ code]my script goes here[ /code] (without the spaces)
will make your code look like Shane's. \:\)

Also, look for the Sanity UDF, or download the Kixtart Development Kit from our web site. KGEN - part of the dev kit - includes sanity, which will scan your script for many common errors.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 200 anonymous users online.
Newest Members
Kelly001, MichaelK72, Janneman, standardbruker, maikoenig2001
17773 Registered Users

Generated in 0.032 seconds in which 0.011 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org