IF setconsole("hide") ENDIF ; ; NT/W2K modify welcome text - Kixtart 3.63, 4.00 ; ; (c) scripting@wanadoo.nl - 2001 ; ; vs 1.02 - program ; ; 1.00 (20010505) original version ; 1.01 (20010701) - extract $ivalue to site defineable block. user can ; specify ; - $wLegalNoticeCaption ; - $wLegalNoticeText ; - $wLogonPrompt ; - $wWelcome ; - introduction of SKIP set_mode. it will only show ; the actual settings ; - new user information included by using $os variable ; 1.02 (20011120) - add "windows XP" ; - layout corrections ; $prgrm_version="1.02" ; $cr=CHR(10) $lf=CHR(13) $eol=$lf+$cr ; --------------------------------------------------------------------------- ; - site defined settings - ; --------------------------------------------------------------------------- $set_mode="skip" ; - yes = set welcome text ; - no = remove welcome text ; - skip = show actual welcome text $debug_mode="yes" ; - yes = user information to screen $wLegalNoticeCaption="YOUR ORGANIZATION" ; $wLegalNoticeText= " Note: internal systems must be used only for"+$eol $wLegalNoticeText=$wLegalNoticeText+" conducting business, or for purpose"+$eol $wLegalNoticeText=$wLegalNoticeText+" authorized by management."+$eol $wLegalNoticeText=$wLegalNoticeText+$eol $wLegalNoticeText=$wLegalNoticeText+" Use is subject to audit at any time by the management."+$eol $wLegalNoticeText=$wLegalNoticeText+$eol $wLegalNoticeText=$wLegalNoticeText+" Last successful logon at "+LCASE(@day)+" "+@mdayno+"-"+LCASE(substr(@month,1,3))+"-"+@year+" "+@time ; $wLogonPrompt="Enter a username and password that is valid for this system." ; $wWelcome=" to YOUR COMPANY network" ; - text beside 'Begin Logon', 'Logon Information', 'Workstation Locked' + 'Unlock Workstation' - ; --------------------------------------------------------------------------- ; - - ; --------------------------------------------------------------------------- IF (@inwin = 1) $NT_mode="yes" ELSE $NT_mode="no" ENDIF ; $os="" $os_dos=@dos SELECT CASE ($NT_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP - $os="XP" CASE ($NT_mode = "yes") AND ($os_dos = "5.0") ; - Windows 2000 - $os="W2K" CASE ($NT_mode = "yes") ; - Windows NT - $os="NT4" CASE ($NT_mode <> "yes") AND ($os_dos = "4.90") ; - Windows ME - $os="ME" CASE ($NT_mode <> "yes") AND ($os_dos = "4.10") ; - Windows 98 - $os="W98" CASE ($NT_mode <> "yes") AND ($os_dos = "4.0") ; - Windows 95 - $os="W95" CASE 1 $os="???" ; - undetermined - ENDSELECT ; IF ($NT_mode = "yes") $ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" IF (ExistKey($ikey) = 0) $ikey_ex="LegalNoticeCaption" $ivalue=$wLegalNoticeCaption GOSUB update_welcome_text ; $ikey_ex="LegalNoticeText" $ivalue=$wLegalNoticeText GOSUB update_welcome_text ; $ikey_ex="LogonPrompt" $ivalue=$wLogonPrompt GOSUB update_welcome_text ; $ikey_ex="Welcome" $ivalue=$wWelcome GOSUB update_welcome_text ENDIF ELSE IF ($debug_mode = "yes") ? "Update Welcome Messages - "+@kix ? ? "$$wLegalNoticeCaption" ? " "+$wLegalNoticeCaption ? "$$wLegalNoticeText" ? $wLegalNoticeText ? "$$wLogonPrompt" ? " "+$wLogonPrompt ? "$$wWelcome" ? " "+$wWelcome ? ENDIF ENDIF GOTO end_script :update_welcome_text SELECT CASE ($set_mode = "yes") IF ($debug_mode = "yes") IF (len(ReadValue($ikey, $ikey_ex)) <> 0) ? "<<<<<< WELCOME (old): "+$ikey_ex+"=" ? ReadValue($ikey, $ikey_ex) ELSE ? "<<<<<< WELCOME (old): "+$ikey_ex+"="+ReadValue($ikey, $ikey_ex) ENDIF ENDIF IF (ReadValue($ikey, $ikey_ex) <> $ivalue) IF (WriteValue($ikey, $ikey_ex, $ivalue, "REG_SZ") <> 0) ? "Warning WELCOME-"+$ikey_ex+" "+@error+": "+@serror ENDIF ENDIF IF ($debug_mode = "yes") IF (len(ReadValue($ikey, $ikey_ex)) <> 0) ? ">>>>>> WELCOME (new): "+$ikey_ex+"=" ? ReadValue($ikey, $ikey_ex) ELSE ? ">>>>>> WELCOME (new): "+$ikey_ex+"="+ReadValue($ikey, $ikey_ex) ENDIF ENDIF IF ($debug_mode = "yes") ? ENDIF CASE ($set_mode = "no") IF (ExistKey($ikey) = 0) IF (WriteValue($ikey, $ikey_ex, "", "REG_SZ") <> 0) ? "Warning WELCOME-"+$ikey_ex+" "+@error+": "+@serror ENDIF ENDIF IF ($debug_mode = "yes") ? "Remove WELCOME: "+$ikey_ex+"="+ReadValue($ikey, $ikey_ex) ENDIF CASE ($set_mode = "skip") IF ($debug_mode = "yes") ? Substr($ikey_ex+" ",1,20)+" "+ReadValue($ikey, $ikey_ex) ENDIF ENDSELECT RETURN :end_script IF ($debug_mode = "yes") SELECT CASE ($set_mode = "yes") ? "Informative Welcome.KIX "+$os+": set_mode="+LCASE($set_mode)+" => update welcome info" CASE ($set_mode = "no") ? "Informative Welcome.KIX "+$os+": set_mode="+LCASE($set_mode)+" => remove welcome info" CASE ($set_mode = "skip") ? "Informative Welcome.KIX "+$os+": set_mode="+LCASE($set_mode)+" => show welcome info" CASE 1 ? "Informative Welcome.KIX "+$os+": set_mode="+LCASE($set_mode)+" => possible settings are 'yes/no/skip'" ENDSELECT IF ($NT_mode <> "yes") ? " no welcome info possible on "+$os+" version." ENDIF BREAK OFF flushkb