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
|