Howard,

Please close the other TOPICS. It is a Starters question, not a General,
and I can't use POST PREP in the General forum. [Wink]

Rbardo,

LOGON.BAT
code:
@ECHO OFF
net time \\mail /set /y
%0\..\WKix32.exe /i /d %0\..\KIXTART.KIX

Here is an attempt at cleaning up your script some. I have not reviewed or
confirmed that any of it works. You need to review and test yourself.

If you DO NOT have any Windows 9x systems to support you do not need
to use the %0\..\ parameters for the calling script. You can simply
run WKIX32.EXE KIXTART.KIX
and your NT/2000/XP/2003 systems will run KiXtart just fine.
Also, you would not want to run the /d DEBUG switch with a production script
it is only used to help track down problems with the script.

By default, KiXtart automatically looks for a personal script for the
current user ("Username.KIX"). If it does not find one, it looks for
the default script, "KIXTART.KIX". You can override this behavior by
specifying one or more scripts after Kix32.exe on the commandline

Copy the code below and save it as KIXTART.KIX and place it into your NETLOGON
folder. Then set your clients to run WKIX32.EXE KIXTART.KIX (for NT systems)
Windows 9x does require the %0\..\ in a batch file.






IF @INWIN=1 ; Excludes all Windows 9x systems
IF LocalAdmin ; Only runs if the user has Local workstation admin rights
; Most installers and uninstallers will not run if the user
; does not have Admin rights
$CheckWS=ReadValue('HKLM\Software\MyCompany\WS', 'RANUNINSTALLER')
IF $CheckWS <> 1
IF EXIST('%ProgramFiles%\OfficeView Pro\uninstWS.exe')
SHELL '%COMSPEC% /C %ProgramFiles%\OfficeView Pro\uninstWS.exe /S'
$MarkWS=WRITEVALUE('HKLM\Software\MyCompany\WS', 'RANUNINSTALLER', '1', 'REG_SZ')
; Mark the registry so that this program does not run every time the user logs in
ENDIF
ENDIF
; I assume you are running this PC Asset Navigator program
; http://www.a-navigator.com/an/index.html
USE W: /DELETE /PERSISTENT
USE W: '\\holdem\asset_db$'
SHELL SHELL '%COMSPEC% /C W:\ina32.exe'
USE W: /DELETE /PERSISTENT
ENDIF
ENDIF


; The rest of the script will run for all systems including Windows 9x

USE J: /DELETE /PERSISTENT
USE J: '\\terminal\slip_stream'
$MyDox = '%COMSPEC% /C REGEDIT /S j:\registry\mydox.reg >nul 2>nul'
$HideC = '%COMSPEC% /C REGEDIT /S j:\registry\hide_c.reg >nul 2>nul'
$Outlook = '%COMSPEC% /C REGEDIT /S j:\registry\outlook.reg >nul 2>nul'
; Not sure what this does, but KiX can do all the registry edits natively
USE J: /DELETE /PERSISTENT

use g: '\\ntbaksrv\common'
use i: '\\ntbaksrv\prod'
use k: '\\ntbaksrv\service'
use m: '\\ntserver\sdpcmrpw'
use o: '\\royal\mis'
use y: '\\terminal\share_point'
; use Z: /home ; Don't use this. Map it via the User Manager or AD tools
; Windows 9x Can Not map the Z: drive as the redirector uses this
; drive during the logon process

SHELL '%COMSPEC% /C \\Ntbaksrv\NETLOGON\use.exe'
; The shell command waits until the program completes before returning to the script

; No need to run Printers.kix as a seperate file unless you really want to

;printers.kix:
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dim $priReg, $x, $i, $rc, $ps
$loc='HKEY_CURRENT_USER\Network\LPT1'
$reg='HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion'
$dev=$reg+'\Devices'
$nprt=split(READVALUE($reg+'\Windows','Device'),',')[0]
$sysdrv=SUBSTR('%WINDIR%',1,2)

IF EXIST('H:')
$ps='H:\Scripts_DO_NOT_DELETE'
ELSE
$ps=$sysdrv+'\Scripts'
ENDIF
IF 0=EXIST($ps)
MD $ps
ENDIF
$ps=$ps+'\Printsetup.ini'

$i=0
DO
IF '\\'=LEFT($x,2)
$priReg=$priReg+$x
ENDIF
$x=ENUMVALUE($dev,$i)
$i=$i+1
UNTIL @error

IF LEN($priReg)
$rc=WRITEPROFILESTRING($ps,'Printers','','')
$priReg=split($priReg,'\\')
FOR $i=1 to ubound($priReg)
$rc=WRITEPROFILESTRING($ps,'Printers',$i,'\\'+$priReg[$i])
NEXT
ENDIF

SELECT
CASE INSTR($nprt,'\\') ;WRITE THE DEFAULT PRINTER TO THE CONFIG
$rc=WRITEPROFILESTRING($ps,'Printers','Default',$nprt)
USE LPT1: /delete /persistent
USE LPT1: $nprt /persistent
CASE $nprt='' AND EXIST($ps) ;NO DEFAULT PRINTER, LOAD PRINTERS FROM SAVED INFO
FOR EACH $key IN split(readprofilestring($ps,'Printers',''),chr(10))
$nul=addprinterconnection(readprofilestring($ps,'Printers',$key))
NEXT
$nprt=READPROFILESTRING($ps,'Printers','Default')
$rc=SETDEFAULTPRINTER($nprt)
USE LPT1: $nprt /persistent
CASE NOT INSTR($nprt,'\\') ;LOCAL PRINTER DEFAULT, SO WE WANT TO REMOVE NETWORK MAPPING
USE LPT1: /delete /persistent
ENDSELECT

function LocalAdmin()
$LocalAdmin=ingroup('@wksta\'+sidtoname('S-1-5-32-544'))-1+@inwin
endfunction