hi everyone,

please be patient with me I am new to kix and the forums,

I have been tasked to help speed up the login process at my clients site, however I am not familiar with kix scripting at all.

I was wondering if you beautiful people on the forums could help me

I've attached the current kix login script for reference.

is the script inefficient? are there better ways of doing the logon process?

 Code:
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;  The Benevolent Society
;  Enterprise Logon Script
;
;  Last Ammended:  20.05.2010 by Brendan

;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

$CG = "g+/n" ; Good Colour (Green)
$CB = "r+/n" ; Bad Colour (Red)
$CN = "w/n" ; Normal Colour (White)
;IF _ERR = 0 COLOR $CG "   Done" COLOR $CN ELSE COLOR $CB "   Failed" COLOR $CN ENDIF

; Check to see if the user is running in a Terminal Session
If @TSSESSION ? "This is a Production Terminal Services Session" ?
	    
	;------------------------------------------------------
	; DRIVE MAPPINGS
	;------------------------------------------------------
	
	; Cleanup and map global drives
	? "Mapping user drives..."
	Use "*" /delete
	Use H:\\ * .local\dfs\ctxusers\%USERNAME%
	Use J:\\ * .local\dfs\data
	Use S:\\ * .local\dfs\shared
	Use T:\\ * .local\dfs\applications
	Use W:\\ * .local\dfs\tsprof\%USERNAME%
	Use X:\\ * .local\dfs\mailarch\%USERNAME%
	" [ Completed ]"
	
	; Map the P: drive depending on user group access.  Only the first matching CASE will be run
	? "Mapping P drive..."
	Select
			
		Case InGroup("LOS_Multi")
			Use P:\\ * .local\dfs\Program
			
		Case InGroup("LOS_CCH")
			Use P:\\ * .local\dfs\Program\CCH
			
		Case InGroup("LOS_ECS")
			Use P:\\ * .local\dfs\Program\ECS
			
		Case InGroup("LOS_NENWSWNSW")
			Use P:\\ * .local\dfs\Program\NENWSWNSW
			
		Case InGroup("LOS_FYL")
			Use P:\\ * .local\dfs\Program\FYL
			
		Case InGroup("LOS_PA")
			Use P:\\ * .local\dfs\Program\PA
			
		Case InGroup("LOS_QLD")
			Use P:\\ * .local\dfs\Program\QLD
			
		Case InGroup("LOS_RA")
			Use P:\\ * .local\dfs\Program\RA
			
		Case InGroup("LOS_SLA")
			Use P:\\ * .local\dfs\Program\SLA
			
		Case InGroup("LOS_SS")
			Use P:\\ * .local\dfs\Program\SS
			
		Case InGroup("LOS_SWS")
			Use P:\\ * .local\dfs\Program\SWS
	EndSelect
	" [ Completed ]"
	
	
	;------------------------------------------------------
	; FLEX PROFILES SETUP
	;------------------------------------------------------
	? "Restoring FLEX Profile..."
	;Run the Flex Framework scripts and settings
	Shell 'cscript /nologo "%PROGRAMFILES%\Immidio\Flex Profiles\Flex_Framework.vbs" LOGON "\\*.local\netlogon\Flex_Config"'
	" [ Completed ]"
	    
	;------------------------------------------------------
	; DESKTOP ENVIRONMENT SETUP
	;------------------------------------------------------
	? "Building Desktop and Start Menu..."
	RedirectOutput(NUL, 1)
	;Copy Policies and Procedures shortcut to desktop
	;IF EXIST("H:\Desktop\Forms Index.lnk") = 0
	;SHELL 'robocopy "\\*.local\dfs\tsprof\template\Desktop" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	
	;IF EXIST("H:\Desktop\Policies and Procedures Index.lnk") = 0
	Shell 'robocopy "\\*.local\dfs\tsprof\template\Desktop" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	
	If InGroup("FA_BF_ALLSTAFF")
		Shell 'robocopy "\\*.local\dfs\shared\Operations\Brighter Futures" "H:\Desktop" "Brighter Futures Assessment Tool.pdf.lnk" /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Shell 'robocopy "\\*.local\dfs\shared\Operations\Brighter Futures" "H:\Desktop" "User Guide - Brighter Futures Assessment Tool.pdf.lnk" /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	
	;Copy the First-Run key for each user
	If Exist("W:\SETTINGS\FLEX\Outlook2003.zip")
		$_outlookset = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Outlook\Setup", "First-Run")
		WriteValue("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\11.0\Outlook\Setup", "First-Run", $_outlookset, "REG_BINARY")
	EndIf
	
	;Build the start menu based on user group access
	Shell 'robocopy "\\*.local\dfs\tsprof\template\common\Start Menu" "%USERPROFILE%\Start Menu" * /MIR /E /R:0 /W:1 /LOG:"%TEMP%\login.log"'
	
	If InGroup("AP_StarCareMOS")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\StarCareMOS\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Use L:\\ * .local\dfs\Applications\StarcareUI\%USERNAME%
	EndIf
	
	If InGroup("AP_BESS")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\BESS" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
				
	EndIf
	
	If InGroup("Domain Users")
		;SHELL 'robocopy "\\*.local\dfs\tsprof\template\Intranet" "%USERPROFILE%\Start Menu\Programs\Startup" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Intranet_1\Desktop" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
				
	EndIf
	
	If InGroup("AP_BESS_TEST")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\BESS_TEST" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		
	EndIf
	
	If InGroup("AP_MOODLE")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\MOODLE" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		
	EndIf
	
	If InGroup("AP_LACES")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\LACES" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		
	EndIf
	
	If InGroup("AP_ServiceDesk")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\ServiceDesk" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		
	EndIf
	
	If InGroup("AP_Avaya_ContactStore")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Avaya_ContactStore" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		
	EndIf
	
	If InGroup("AP_Avaya_CCR")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Avaya_CCR" "H:\Desktop" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		
	EndIf
	
	If InGroup("AP_ICON_REMOVE")
		Del("H:\Desktop\Service Desk.url")
				
	EndIf
	
	If InGroup("AP_StarCareSPB")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\StarCareSPB\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Use L:\\ * .local\dfs\Applications\StarcareUI\%USERNAME%
	EndIf
	If InGroup("AP_StarCareFinance")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\StarCareFinance\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Use L:\\ * .local\dfs\Applications\StarcareUI\%USERNAME%
	EndIf
	If InGroup("AP_Publisher")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Publisher\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_Project")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Project\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_Visio")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Visio\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Call "\\*.local\netlogon\visio11.kix"
	EndIf
		
	;IF INGROUP("AP_Heat")
	;SHELL 'robocopy "\\*.local\dfs\tsprof\template\Heat\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	;IF INGROUP("AP_ActiveSync")
	;SHELL 'robocopy "\\*.local\dfs\tsprof\template\ActiveSync\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	If InGroup("AP_AcroWriter")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\AcroWriter\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_Finance")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\AcroWriterx\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	;IF INGROUP("AP_Finance")
	;SHELL 'robocopy "\\*.local\dfs\tsprof\template\finance\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	If InGroup("AP_GreatPlains")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\GP\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_CHRIS21")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Chris21\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Use Q:\\hodb01\data\chris21
	EndIf
	If InGroup("Citrix Admin Shadow Only")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\Shadow\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_MealManager")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\MealManager37\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Use G:\\aud5500046\scanning
	EndIf
	If InGroup("AP_ANSTAT")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\ANSTAT\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_CFCCSSS")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\CFCCSSS\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_FRxViewer")
		Shell 'robocopy "\\*.local\dfs\TSProf\template\FRxViewer\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_FRxDesigner")
		Shell 'robocopy "\\*.local\dfs\TSProf\template\FRxDesigner\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_FRxAdmin")
		Shell 'robocopy "\\*.local\dfs\TSProf\template\FRxAdmin\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Use Y:\\pawb02\FRxWebPort
	EndIf
	;IF INGROUP("AP_OpenAlms")
	;SHELL 'robocopy "\\*.local\dfs\TSProf\template\OpenAlms\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	;IF INGROUP("AP_CRC")
	;SHELL 'robocopy "\\*.local\dfs\TSProf\template\crc\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	If InGroup("AP_Carelink")
		Shell 'robocopy "\\*.local\dfs\TSProf\template\carelink\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_PARCDB")
		Shell 'robocopy "\\*.local\dfs\TSProf\template\PARC\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_PARCQLD")
		Shell 'robocopy "\\*.local\dfs\TSProf\template\PARCQLD\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_BFD_UI")
		Shell 'robocopy "\\*.local\dfs\TSProf\template\BFD\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Use N:\\ * .local\dfs\Applications\BFDUI\%USERNAME%
	EndIf
	If InGroup("AP_ThankQ")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\ThankQ\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
		Call "\\*.local\netlogon\thankq.kix"
	EndIf
	;IF INGROUP("AP_Nvivo")
	;SHELL 'robocopy "\\*.local\dfs\tsprof\template\Nvivo\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	;IF INGROUP("AP_Hartmann")
	;SHELL 'robocopy "\\*.local\dfs\tsprof\template\Hartmann\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	;ENDIF
	If InGroup("AP_TCM_Compacks")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\TCMcompack\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_EndNote")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\EndNote\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_TCM7")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\TCM7\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_ACSAA")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\ACSAA\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_ClientManager")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\ClientManager\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("AP_Finance")
		Shell 'robocopy "\\*.local\dfs\tsprof\template\GP2010\Start Menu" "%USERPROFILE%\Start Menu" * /E /R:0 /W:1 /LOG+:"%TEMP%\login.log"'
	EndIf
	If InGroup("LS_ThankQ")
		Use M:\\HODB01\Admit
	EndIf
	
	If InGroup("Domain Users")
		$Folder = '\\*.LOCAL\NETLOGON\REGFILES\'
		$File = 'Outlook_Fonts.reg'
		Shell '%WINDIR%\regedit.exe /S ' + $Folder + $File
		Del("C:\Documents and Settings\%Username%\Application Data\Microsoft\Internet Explorer\Quick Launch\Launch Microsoft Office Outlook.lnk")
	EndIf
	
	    
	RedirectOutput("", 1)
	" [ Completed ]"
	    
	;Windows Taskbar setings, no clock
	If InGroup("Domain Users")
		? "Setting taskbar..."
		WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2", "Settings", "28000000ffffffff02000000030000003c0000001e000000feffffff3c020000220300005a020000", "REG_BINARY")
		" [ Completed ]"
	EndIf
	
	;Time entries required for CareManager
	If InGroup("AP_TCM7")
		? "Time settings for CareManager..."
		WriteValue("HKEY_CURRENT_USER\Control Panel\International", "s1159", "AM", "REG_SZ")
		WriteValue("HKEY_CURRENT_USER\Control Panel\International", "s2359", "PM", "REG_SZ")
		" [ Completed ]"
	EndIf
	    
	;Set Multilingual Keyboard Layouts
	If InGroup("AP_Multilingual")
		? "Loading keyboard layouts..."
		WriteValue("HKEY_CURRENT_USER\Keyboard Layout\Preload", "1", "00000c09", "REG_SZ") ;English (Australian)
		WriteValue("HKEY_CURRENT_USER\Keyboard Layout\Preload", "2", "00003001", "REG_SZ") ;Arabic (Lebanon)
		WriteValue("HKEY_CURRENT_USER\Keyboard Layout\Preload", "3", "00000409", "REG_SZ") ;English (United States)
		WriteValue("HKEY_CURRENT_USER\Keyboard Layout\Preload", "4", "0000042a", "REG_SZ") ;Vietnamese
		WriteValue("HKEY_CURRENT_USER\Keyboard Layout\Preload", "5", "0000040d", "REG_SZ") ;Hebrew
		" [ Completed ]"
	EndIf      
	
	
	;Allow Flash Domains
	If InGroup("Domain Users")
		? "Loading Flash Domains..."
		Call "\\*.local\netlogon\Flash.kix"
		" [ Completed ]"
	EndIf
	
	
	;Adobe Reader settings, Open Cross-Documents
	If InGroup("Domain Users")
		? "Setting Adobe Reader..."
		WriteValue("HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\9.0\Originals", "bOpenInPlace", "00000000", "REG_DWORD")
		WriteValue("HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\9.0\Originals", "bBrowserIntegration", "00000001", "REG_DWORD")
		WriteValue("HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\9.0\FormsPrefs", "bInlineAutoComplete", "00000000", "REG_DWORD")
		WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\crmaddin.Addin", "LoadBehavior", "2", "REG_DWORD")
		WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\crmexceladdin.Addin", "LoadBehavior", "2", "REG_DWORD")
		" [ Completed ]"
		Del("C:\Documents and Settings\%Username%\Application Data\Microsoft\Internet Explorer\Quick Launch\Desktop.ini")
	EndIf
	
	;MS CRM
	If InGroup("UserGroup {3c7fb4c4-ad64-4b18-8250-65434910cbb8}")
		? "ENABLE OUTLOOK CLIENT for CRM"
		Call "\\*.local\netlogon\crm.kix"
		" [ Completed ]"
	EndIf
	   
	? "Connecting Thin Print..."
	Shell 'cmd /c "tpautoconnect -v -q > h:\tpautoconnect.log"'
	" [ Completed ]"
	    
	;------------------------------------------------------
	; Deleting printers
	;------------------------------------------------------
	? "Deleting Printers..."
	Shell 'cscript \\*.local\netlogon\delete_printers.vbs'
	;get$
	   	
	
EndIf



any help would be greatly appreciated.

thanks in advance
andrew.


Attachments
TBSLogon.kix (329 downloads)
Description:




Edited by Mart (2011-07-04 09:21 AM)