Home / Articles / Adobe Acrobat / Logon Scripts: Using KiXtart and.ini Files

Logon Scripts: Using KiXtart and.ini Files

Article Description

Anybody who manages user accounts knows the advantage of automating the task. The last thing you want to do is visit every desktop to ensure that the users' Windows computers are set up to work properly with your network. One common way to get around this is to use batch files and scripts to smooth the process. Matthew Moran shows you an easy way to gain control of user logons with Kixtart, a free-format scripting language.

Like this article? We recommend

Microsoft Windows Server 2003 Unleashed

Microsoft Windows Server 2003 Unleashed, 2nd Edition

$64.99

The methodology covered in this article is a small sample of my Scripting Framework. Using similar methodology, you can take care of adding printers, icons, applications, registry keys, outlook settings, regional and office specific settings, and much more.

As you can see, KiXtart is a powerful utility for logon scripts and network automation.

Functions File MyFunctions.kix

;===============================================================
Function GroupArray()
;===============================================================
Dim $i
Dim $strGrpLst
Dim $gName
$i = 0
$strGrpLst = ""
Do
 $gName = EnumGroup($i)
 $i = $i + 1
 If Len($gName) > 0
  If Len($strGrpLst) > 0
   $strGrpLst = $strGrpLst + ","
  EndIf
  $strGrpLst = $strGrpLst + $gName
 EndIf
Until Len($gName) = 0
$ary = Split($strGrpLst,",",-1)
;? "Before return array size is:" + Ubound($ary)
$GroupArray = $ary
EndFunction
;===============================================================

;===============================================================
Function GroupMap($inFile,$inSec)
;===============================================================
Dim $tmpDrv
$Sec = ReadProfileString($inFile,$inSec,"") 
$aMaps = Split($Sec,Chr(10),-1)
For Each $a In $aMaps
 $tmpDrv = ReadProfileString($inFile,$inSec,$a)
 $aParms = Split($tmpDrv,",")                     
  $act = Ubound($aParms)
  Use $aParms[0] + ":" $aParms[1]
Next
$GroupMap = 1
EndFunction
;===============================================================

DriveMap.kix file

;===============================================================
Call "MyFunctions.kix"
$aryGroups = GroupArray()
$strIniFile = "c:\kixwork\DriveMappings.ini"
For Each $ae in $aryGroups
  GroupMap($strIniFile,$ae)
Next
;===============================================================

DriveMapping.ini file

;===============================================================

;====================================
; TestGroup 1
;=Start==============================
[Domain Users]
MapDrive1=v,\\servername\sharename
MapDrive2=g,\\servername\sharename
;=End================================

;====================================
; Test Group 2
;=Start==============================
[AGroup]
MapDrive1=h,\\servername\sharename


;====================================
; Test Group 3
;====================================
[BGroup]
MapDrive1=K,\\servername\sharename
;=End================================
;===============================================================