rbardo
Fresh Scripter
Registered: 2003-07-24
Posts: 47
Loc: USA
|
Thanks guys..
Here is the latest that for the most part works except I cant find that .ini file for the printers anywhere.. Yes it does create the folder..
code:
;=============================================================================================== ;**** Created with KiXscripts Editor | http://KiXscripts.com **** ;**** Last Modified on 7/26/2003 at 5:00:40 PM by rbardo **** ;===============================================================================================
;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\VendingData Corporation\WS', 'RANUNINSTALLER') If $CheckWS <> 1 If Exist('%ProgramFiles%\OfficeView Pro\uninstWS.exe') Shell '%COMSPEC% /C %ProgramFiles%\OfficeView Pro\uninstWS.exe /S /y' $MarkWS=WriteValue('HKLM\Software\VendingData Corporation\WS', 'RANUNINSTALLER', '1', 'REG_SZ') ; Mark the registry so that this program does not run every time the user logs in EndIf EndIf ;EndIf ;EndIf ; http://www.a-navigator.com/an/index.html Use W: /DELETE /PERSISTENT Use W: '\\holdem\asset_db$' Shell '%COMSPEC% /C W:\ina32.exe' Use W: /DELETE /PERSISTENT
; The rest of the script will run for all systems including Windows 9x
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'
Copy '\\terminal\desktop\*.*' 'c:\documents and settings\' + @USERID + '\desktop' /s
; 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 ;*********************************************************************** ;** ;** InstallRegFiles($Regfiles) ;** Function InstallRegFiles($Regdir) $RegFiles=$RegDir + "\*.reg" If Exist($Regdir) $RegFile=Dir($Regfiles) While $RegFile<>"" AND @Error=0 ;Install RegFile If $NT_mode="yes" ; If this is NT than don't install regfiles that start with "w9_" If Left($RegFile,3) <> "w9_" stpDbgMessage("Info"," - Installing : " + $Regdir + "\" + $RegFile) If RunShell($windir + "/regedit /s " + $Regdir + "\" + $RegFile)<>0 stpDbgMessage("Error","@ERROR - Regedit : " + $Regdir + "\" + $RegFile,@SERROR) EndIf EndIf Else ; If this is W9x than don't install regfiles that start with "nt_" If Left($RegFile,3) <> "nt_" stpDbgMessage("Info"," - Installing : " + $Regdir + "\" + $RegFile) If RunShell($windir + "/regedit /s " + $Regdir + "\" + $RegFile)<>0 stpDbgMessage("Error","@ERROR - Regedit : " + $Regdir + "\" + $RegFile,@SERROR) EndIf EndIf EndIf $RegFile=Dir() If @Error<>0 AND @Error<>18 stpDbgMessage("Error","@ERROR - Retrieving Files for Dir : " +$Regdir ,@SERROR) EndIf Loop EndIf EndFunction
; Default My Documents to Z: drive ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WriteValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'Personal', 'Z:\\', 'Reg_SZ') WriteValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'My Pictures', 'Z:\\My Pictures', 'Reg_SZ')
;printers.kix ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $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) Dim $priReg, $x, $i, $rc, $ps If Exist('Z:') $ps='Z:\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
Shell '%COMSPEC% /C \\Ntbaksrv\NETLOGON\use.exe'
PLease let me know what you guys think.. Thanks. [ 27. July 2003, 09:18: Message edited by: rbardo ]
_________________________
Ekadanta Mahakaya Surya koti samaprabha
Nirbighnam kurume deva sarbakaryeshu sarbada
|