Page 1 of 1 1
Topic Options
#66184 - 2002-06-06 04:02 PM My logon Script (caution long lines and post)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
This is my logon script. It soes not use any ini files or external data... It detects any and all hardware/software/user/location requirements internal to itself. virtually no external apps are called (scriptit for 1 app install, WSH, and COM are used)

It supports about 2000 users in 13 locations (all running win2k) on nt4 domain.

It installs/updates automatically all software upon a base image of win2k sp2, IE6, MSO2k sp2, and Netmange Chameleon.
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66185 - 2002-06-06 04:05 PM Re: My logon Script (caution long lines and post)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Radimus:

That's really a cool login script, kind of reminds me of the emperor's new clothes [Big Grin]
_________________________
There are two types of vessels, submarines and targets.

Top
#66186 - 2002-06-06 04:06 PM Re: My logon Script (caution long lines and post)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
code:
;**********Revision Record **********
;01.17.2002 - All mappings for \\fdhctlh13 changed to \\mad
;01.18.2002 - BusinessObjects shortcut error corrected.
;01.23.2002 - CTS installation added
;02.04.2002 - ASE 4 upgrade incapacitated & Aspen shortcut icon fixed
;02.14.2002 - Array parsing for user info revised
;02.25.2002 - Added Aspen 5.1 upgrade section and Jim Taylor as Area 2 DCSA
;02.26.2002 - Rem'd Aspen 5.1 upgrade section and added PROXY enforcement
;02.27.2002 - Reinstated Aspen 5.1 upgrade as per Diana Reynold's instructions.
;03.01.2002 - Array parsing for non-standard user names revised
;03.01.2002 - "J" drive added for MCHQ Incidents group as per Wendy Adams request
;03.14.2002 - New CTS 5.0 program installation added
;03.27.2002 - city variable and dcsaname variable added for area offices to accomodate inventory
;03.29.2002 - K: mappings for \\c1dm3\adminacts changed to \\mad\adminacts
;04.01.2002 - K: membership changed to "adminacts" global group per Shawn Phelps
;04.18.2002 - Legal warning text added at logon
;05.23.2002 - Added AHCA WEB url on desktop for all users.
;05.28.2002 - Added Java JInitiator and Letter Listener


;**********End Revision Record **********
go c: CD "C:\" ;make C:\ default environment
? color c+/n "KiXtart "color w/n"is version " color w+/n @kix color w/n
? color y+/n "Determining Area Office and User..." color w/n gosub AreaOffice
? color y+/n "Determining OS on Computer..." color w/n gosub OperatingSystem
? color y+/n "Setting Common Variable Values..." color w/n gosub Variables
? color y+/n "Determining Computer Hardware..." color w/n gosub Hardware
? color y+/n "Setting Network Policies based on Groups..." color w/n gosub GroupPolicy
? color y+/n "Checking Applications..." color w/n gosub UpdateApps
? color y+/n "Mapping Drives based on Groups..." color w/n gosub GroupDrives
? color y+/n "Maintaining Applications based on Groups..." color w/n gosub GroupApps
? color y+/n "Performing Hardware and Software Inventory..." color w/n gosub Inventory
? color y+/n "Mapping Area Office Drives..." color w/n Call "$logon\AreaDrives.kix"
? color y+/n "Running Custom Area Office scripts..." color w/n Call "$logon\AreaScript.kix"
? color g+/n "Logon Script is Complete." color w/n ?

EXIT
;*********************************** END OF LOGON SCRIPT, Returning to Logon.bat *********************************
;*****************************************************************************************************************
;*****************************************************************************************************************
;****************************************** START OF SUBROUTINES *************************************************
;*****************************************************************************************************************
;*****************************************************************************************************************
;***************************************** start of Area Office **************************************************
:AreaOffice
$nic=0
:nicloop
$mygw=enumipinfo($nic,3)
select ; determine physical location of computer
Case $mygw="164.51.84.129" $Location="01" $city="Pensacola" $mis="eilandj"
Case $mygw="164.51.61.17" $Location="02" $city="Panama City" $mis="taylorj"
Case $mygw="168.82.5.1" $Location="02" $city="St Augustine" $mis="taylorj"
Case $mygw="164.51.61.1" $Location="02" $city="Panama City" $mis="taylorj"
Case $mygw="164.51.200.129" $Location="03" $city="Alachua" $mis="thiesses"
Case $mygw="164.51.61.193" $Location="03" $city="Ocala" $mis="thiesses"
Case $mygw="164.51.61.225" $Location="03" $city="Ocala" $mis="thiesses"
Case $mygw="164.51.85.1" $Location="04" $city="Jacksonville" $mis="stokesk"
Case $mygw="164.51.39.129" $Location="05" $city="St Petersburg" $mis="fuentesm"
Case $mygw="164.51.163.129" $Location="05" $city="St Petersburg" $mis="fuentesm"
Case $mygw="164.51.34.1" $Location="06" $city="Tampa" $mis="wheelerc"
Case $mygw="164.51.41.129" $Location="07" $city="Orlando" $mis="mcdaniek"
Case $mygw="164.51.103.1" $Location="08" $city="Ft Myers" $mis="fordp"
Case $mygw="164.51.33.1" $Location="09" $city="W Palm Beach" $mis="matza"
Case $mygw="164.51.28.1" $Location="10" $city="Ft Lauderdale" $mis="ullmanc"
Case $mygw="164.51.106.1" $Location="11" $city="Miami" $mis="kudehint"
Case $mygw="164.51.63.225" $Location="11" $city="Miami" $mis="kudehint"
Case $mygw="168.82.11.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.12.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.13.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.22.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.31.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.32.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.33.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.34.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.35.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.36.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.37.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.42.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.56.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case $mygw="168.82.59.1" $Location="TLH" $city="Headquarters" $mis="edwardjt"
Case @ras $Location="RAS" $city="Headquarters" $mis="edwardjt"
Case 1 $Location="00" ;? "Cannot determine location of computer"
endselect
if $Location = "00" and val($nic) < 10
$nic=val($nic)+1
goto nicloop
endif
if $Location = "00"
$=sendmessage("wheelerc","IP Detection Failed on @wksta @crlf @userid @crlf @lserver @crlf @scriptdir @crlf $mygw")
endif
select ; determine area office membership
case ingroup("fdhc\area01") $area="01" $dcsa="eilandj" $dcsaname="Eiland"
case ingroup("fdhc\area02") $area="02" $dcsa="taylorj" $dcsaname="Taylor"
case ingroup("fdhc\area03") $area="03" $dcsa="thiesses" $dcsaname="Thiessen"
case ingroup("fdhc\area04") $area="04" $dcsa="stokesk" $dcsaname="Stokes"
case ingroup("fdhc\area05") $area="05" $dcsa="fuentesm" $dcsaname="Fuentes"
case ingroup("fdhc\area06") $area="06" $dcsa="wheelerc" $dcsaname="Wheeler"
case ingroup("fdhc\area07") $area="07" $dcsa="mcdaniek" $dcsaname="McDaniel"
case ingroup("fdhc\area08") $area="08" $dcsa="fordp" $dcsaname="Ford"
case ingroup("fdhc\area09") $area="09" $dcsa="matza" $dcsaname="Matz"
case ingroup("fdhc\area10") $area="10" $dcsa="ullmanc " $dcsaname="Ullman"
case ingroup("fdhc\area11") $area="11" $dcsa="kudehint" $dcsaname="Kudehinbu"
case @userid<>"administrator" and $Location<>"TLH"
$area="00" ? "Cannot determine Area Office of User"
case $Location<>"TLH" $area=$Location ? "Assuming Area Office by IP Address"
endselect

$group ="area$area"
select ; determine departmental membership
case ingroup($group+"med") $dept="Medicaid"
case ingroup($group+"mis") $dept="MIS"
case ingroup($group+"mqa") $dept="MQA"
case ingroup($group+"hqa") $dept="HQA"
case ingroup($group+"legal") $dept="Legal"
case ingroup($group+"OIG") $dept="OIG"
case ingroup($group+"pi") $dept="OIG"
case ingroup($group+"P&&C") $dept="P&C"
case ingroup($group+"plans") $dept="P&C"
case 1 $dept="" ? "Cannot determine @userid group membership in $group"
endselect

$admin=0 $does="does not"
if ingroup("\\@wksta\Administrators")>0 $admin=1 $does="does" endif

if instr("@fullname",";")
$descarray =split("@fullname",";")
$positionnum =trim($descarray[0])
$username =trim($descarray[1])
else
$=sendmessage("$dcsa","@lserver reports: @userid is not formatted correctly or account details unavailable@crlf Fullname=@fullname @crlf Comment=@comment")
$positionnum ="00000"
$username ="@userid"
endif
if instr("$username",",")
$namearray =Split("$username",",")
$Lastname =trim($namearray[0])
$firstname =trim($namearray[1])
else
$=sendmessage("$dcsa","@userid is not formatted correctly or account details unavailable @crlf Fullname=@fullname")
$Lastname ="lastname"
$firstname ="firstname"
endif

? " Current user "color c+/n $username color w/n " is a member of "color w+/n"Area" $area $dept color w/n
? " Current user " color c+/n $does color w/n " have Local Admin on " color w+/n"@wksta" color w/n
? " Computer "color c+/n"@wksta "color w/n "is located in "color w+/n "Area" $Location color w/n

Return
;******************************************* end of AreaOffice ****************************************************
;******************************************************************************************************************
;******************************************* start of OperatingSystem *********************************************
:OperatingSystem
select
Case @producttype = "Windows XP Professional" $os="WinXP" $ostype="WinNT"
Case @producttype = "Windows 2000 Professional" $os="Win2K" $ostype="WinNT"
Case @producttype = "Windows NT Workstation" $os="WinNT" $ostype="WinNT"
endselect
? " Installed "color c+/n "Operating System " color w/n "is " color w+/n @producttype " " @csd color w/n
return
;******************************************* end of OperatingSystem ***********************************************
;******************************************************************************************************************
;******************************************* start of Variables ***************************************************
:Variables
$server="\\a$area"
$logon ="$server\logon"
$setup ="\\ada$area\setup$$"
$HKLMS ="HKEY_LOCAL_MACHINE\Software"
$HKCUS ="HKEY_CURRENT_USER\Software"
$HKCPCPD ="HKEY_CURRENT_USER\Control Panel\Desktop"
$HKLMHDS ="HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System"
$HKLMSCCS ="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet"
$HKCUSMWCV ="$HKCUS\Microsoft\Windows\CurrentVersion"
$HKLMSMWCV ="$HKLMS\Microsoft\Windows\CurrentVersion"
$HKLMSMWNTCV ="$HKLMS\Microsoft\Windows NT\CurrentVersion"
$HKCUSMWNTCV ="$HKCUS\Microsoft\Windows NT\CurrentVersion"
$NAITVD ="$HKLMS\Network Associates\TVD"
$vsengine ="$NAITVD\Shared Components\VirusScan Engine\4.0.xx"
$mcupdate ="$NAITVD\Shared Components\McUpdate\CurrentVersion"

$vscandir =readvalue("$NAITVD\VirusScan","szInstallDir")
$vscanver =readvalue("$NAITVD\VirusScan","szCurrentVersionNumber")
$vscaneng =readvalue("$vsengine","szEngineVer")
$vscandat =readvalue("$vsengine","szDatVersion")
$vsdatdir =readvalue("$vsengine","szInstallDir")
$vsdatdate =readvalue("$vsengine","szDatDate")
$mcupdexe =readvalue("$mcupdate","szInstallDir")
$appdata =readvalue("$HKCUSMWCV\Explorer\Shell Folders","AppData")
$desktop =readvalue("$HKCUSMWCV\Explorer\Shell Folders","Desktop")
$startmenu =readvalue("$HKCUSMWCV\Explorer\Shell Folders","Start Menu")
$favorites =readvalue("$HKCUSMWCV\Explorer\Shell Folders","Favorites")
$alldesktop =readvalue("$HKLMSMWCV\Explorer\User Shell Folders","Common Desktop")
$allstartmenu=readvalue("$HKLMSMWCV\Explorer\User Shell Folders","Common Start Menu")

$qlbar = "$appdata\Microsoft\Internet Explorer\Quick Launch"
$Biosv="" $Biosd="" $Make="" $Model="" $SerNo="" $Case=""
$CPUfm="" $CPUsp="" $dimm1="" $dimm2="" $dimm3="" $memory=""
$c=chr(44) $modem="" $chamver="" $Winzipver="" $Impver="" $asefiletime=""

return

;******************************************* end of Variables *****************************************************
;******************************************************************************************************************
;******************************************** start of Hardware *********************************************************
:Hardware
$a=0
dim $mem[4]
$Biosv=WMIQuery("SMBIOSBIOSVersion","Win32_BIOS")
$biosd=WMIQuery("Version","Win32_BIOS")
$Make =WMIQuery("Manufacturer","Win32_ComputerSystem")
$Model=WMIQuery("Model","Win32_ComputerSystem")
$SerNo=WMIQuery("SerialNumber","Win32_BIOS")
if $SerNo < " "
$SerNo=WMIQuery("SMBIOSAssetTag","Win32_SystemEnclosure")
endif
$CPUsp=WMIQuery("CurrentClockSpeed","Win32_Processor")
for each $dimm in Split(WMIQuery("Capacity","Win32_PhysicalMemory"),"|")
$mem[$a]=val($dimm) / 1048576
$memory=val($memory)+val($mem[$a])
$a=val($a)+1
next
$dimm1=$mem[0] $dimm2=$mem[1] $dimm3=$mem[2]
$Modem=WMIQuery("Description","Win32_POTSModem")
select
case instr("$model","deskpro") $case="Desktop"
case instr("$model","latitude") $case="Laptop"
case 1 $case="Not Specified"
endselect

? " Computer "color c+/n "Manufacturer " color w/n "is " color w+/n $Make color w/n
? " Computer "color c+/n "Model " color w/n "is " color w+/n $Model color w/n
? " Computer "color c+/n "Serial Number " color w/n "is " color w+/n $SerNo color w/n
? " Computer "color c+/n "Processor Speed " color w/n "is " color w+/n $CPUsp "Mhz" color w/n
? " Computer "color c+/n "Memory " color w/n "is " color w+/n $memory "MB" color w/n
return
;********************************************* end of Hardware ***********************************************************
;*************************************************************************************************************************
;******************************************* start of GroupPolicy ********************************************************
:GroupPolicy
if $os="Win2k" and $admin=1
;? " Disable browsemaster for win2k machines"
$MSL=ReadValue("$HKLMSCCS\Services\Browser\Parameters","MaintainServerList")
if $MSL="auto"
$=WriteValue("$HKLMSCCS\Services\Browser\Parameters","MaintainServerList","no",REG_SZ)
endif
;? " Synchronizing "color c+/n"System Time "color w/n"with Server " color w+/n "$server" color w/n
settime "$server"
;? " Applying Server comment"
$=writevalue("$HKLMSCCS\Services\LanmanServer\Parameters","srvcomment", "Win2k $group @fullname",REG_SZ)
; ? " Disable Autodial"
$rasauto="$HKLMSCCS\Services\RasAuto"
$autovalue=readvalue("$rasauto","Start")
if @error=0 and $autovalue<>3
$=writevalue("$rasauto","Start","3",REG_DWORD)
endif
; ? " Disable LPD service"
$NMLPD="$HKLMSCCS\Services\NMLPD"
$autovalue=readvalue("$NMLPD","Start")
if @error=0 and $autovalue<>3
$=writevalue("$NMLPD","Start","3",REG_DWORD)
endif
;? " Enable Legal Message"
$LGL=ReadValue("$HKLMSMWNTCV\Winlogon","LegalNoticeCaption")
if $LGL<>"Unauthorized Use Prohibited"
$ltext1="WARNING! By accessing this system you are consenting to system monitoring" +@crlf
$ltext2="and agreeing to follow the Agency's policies regarding acceptable use," +@crlf
$ltext3="protection of information resources, and confidential health care information."+@crlf
$ltext4="Improper or illegal use of this computer may subject you to an investigation" +@crlf
$ltext5="and could result in either disciplinary action in accordance with the Agency's"+@crlf
$ltext6="standards, or possible civil or criminal penalties." +@crlf
$ltext=$ltext1+$ltext2+$ltext3+$ltext4+$ltext5+$ltext6
$=WriteValue("$HKLMSMWNTCV\Winlogon","LegalNoticeCaption","Unauthorized Use Prohibited",REG_SZ)
$=WriteValue("$HKLMSMWNTCV\Winlogon","LegalNoticeText","$ltext",REG_SZ)
endif

endif
if $os="Win2k"
;? " Force IE to open new window"
$=writevalue("$hkcus\Microsoft\Internet Explorer\Main","AllowWindowReuse","0",REG_DWORD)
;? " Applying "color c+/n"Internet Home Page "color w/n"setting"
$=writevalue("$HKCUS\Microsoft\Internet Explorer\main","start page","http://ahcaweb/","REG_SZ")
$=AddKey("$HKCUS\Policies\Microsoft\Internet Explorer\Control Panel")
$=writevalue("$HKCUS\Policies\Microsoft\Internet Explorer\Control Panel","Homepage","1","REG_DWORD")
;? " Configure and enforce Proxy settings"
$ProxyServer="proxy.fdhc.state.fl.us:8080"
$LMIntSettings="$HKLMSMWCV\Internet Settings"
$CUIntSettings="$HKCUSMWCV\Internet Settings"
$=writevalue("$LMIntSettings","ProxySettingsPerUser","0",REG_DWORD)
$=writevalue("$LMIntSettings","ProxyServer","$ProxyServer",REG_SZ)
$=writevalue("$LMIntSettings","ProxyEnable","1",REG_DWORD)
$=writevalue("$LMIntSettings","ProxyOverride","<local>",REG_SZ)
$=writevalue("$CUIntSettings","ProxySettingsPerUser","0",REG_DWORD)
$=writevalue("$CUIntSettings","ProxyServer","$ProxyServer",REG_SZ)
$=writevalue("$CUIntSettings","ProxyEnable","1",REG_DWORD)
$=writevalue("$CUIntSettings","ProxyOverride","<local>",REG_SZ)
$=writevalue("$HKCUS\Microsoft\Internet Explorer\Main","NoUpdateCheck","1",REG_DWORD)
$=writevalue("$HKCUS\Policies\Microsoft\Internet Explorer\Control Panel","Proxy","1",REG_DWORD)
$=writevalue("$HKCUS\Policies\Microsoft\Internet Explorer\Control Panel","Connwiz Admin Lock","1",REG_DWORD)
;? " FRAES User info"
$=writevalue("$HKCUSMWCV\Policies\system","NoDispScrSavPage","0",REG_SZ)
if ingroup("Area_Fraes")=1
if existkey("$HKLMSMWCV\Uninstall\Webshots")=0
$remove=readvalue("$HKLMSMWCV\Uninstall\Webshots","UninstallString")
shell("$remove")
$=Writeprofilestring("$logon\inventory\Uninstall.log","WebShots","@wksta","@date")
endif
;Set default screensaver with 15 minute time out
$=writevalue("$HKCPCPD","ScreenSaveActive","1","REG_SZ")
$=writevalue("$HKCPCPD","ScreenSaverIsSecure","1","REG_SZ")
$=writevalue("$HKCPCPD","ScreenSaveTimeOut","900","REG_SZ")
$=writevalue("$HKCPCPD","ScrnSave.exe","%windir%\System32\Logon.scr","REG_SZ")
$=writevalue("$HKCUSMWCV\Policies\system","NoDispScrSavPage","1",REG_SZ)
endif
endif

return

;******************************************* end of GroupPolicy **********************************************************
;*************************************************************************************************************************
;******************************************* start of UpdateApps *********************************************************
:UpdateApps
if @ras=0 and $Location<>"00" ; Section will not run if dialed in
; **************************** Internet Explorer Section *************************************
$ier=readvalue("$HKLMS\Microsoft\Internet Explorer", "Version")
? " Installed "color c+/n"Internet Explorer"color w/n" is version "color w+/n $ier color w/n

; ****************************** MSOffice version *****************************************
$MSOdir=readvalue("$HKLMSMWCV\App Paths\excel.exe","Path")
$access=getfileversion("$MSOdir\msaccess.exe")
select
case $access="8.0.3512" $asr="97 SR-0"
case $access="8.0.4122" $asr="97 SR-1"
case $access="8.0.5903" $asr="97 SR-2"
case $access="9.0.2720" $asr="2000"
case $access="9.0.3822" $asr="2000 SR-1a"
case $access="9.0.4402" $asr="2000 SR-2"
case $access="9.0.4506" $asr="2000 SR-1a Security Update"
case $access>"10.0" $asr="XP"
endselect
$excel=getfileversion("$MSOdir\excel.exe")
select
case $excel="9.0.2720" $esr="2000"
case $excel="9.0.3822" $esr="2000 SR-1a"
case $excel="9.0.4402" $esr="2000 SR-2"
case $excel="9.0.4430" $esr="2000 SR-1a Security Update"
case $excel="9.0.5519" $esr="2000 SR-1a Security Update"
case $excel>"10.0" $esr="XP"
endselect
$outlook=getfileversion("$MSOdir\outlook.exe")
select
case $outlook="9.0.2711" $osr="2000"
case $outlook="9.0.2416" $osr="2000 SR-1a"
case $outlook="9.0.3821" $osr="2000 SR-1a"
case $outlook="9.0.4257" $osr="2000 SR-2"
case $outlook="9.0.5519" $osr="2000 SR-1a Security Update"
case $outlook>"10.0" $osr="XP"
endselect
$outvctr=getfileversion("$MSOdir\Outlctlx.dll")
if $outvctr="10.0.3124" $osr=$osr+" View Control" endif
$powerpnt=getfileversion("$MSOdir\powerpnt.exe")
select
case $powerpnt="9.0.2716" $psr="2000"
case $powerpnt="9.0.3821" $psr="2000 SR-1a"
case $powerpnt="9.0.4527" $psr="2000 SR-2"
case $powerpnt="9.0.5519" $psr="2000 SR-1a Security Update"
case $powerpnt>"10.0" $psr="XP"
endselect
$pub=getfileversion("$MSOdir\mspub.exe")
select
case $pub="6.0" $bsr="2000"
case $pub="6.0.1.436" $bsr="2000 Update"
case $pub>"10.0" $bsr="XP"
endselect
$Word=getfileversion("$MSOdir\winword.exe")
select
case $word="9.0.2720" $wsr="2000"
case $word="9.0.3822" $wsr="2000 SR-1a"
case $word="9.0.4402" $wsr="2000 SR-2"
case $word="9.0.4527" $wsr="2000 SR-2"
case $word="9.0.5302" $wsr="2000 SR-1a Security Update"
case $word>"10.0" $wsr="XP"
endselect
$office=readvalue("$HKLMSMWCV\Uninstall\{00010409-78E1-11D2-B60F-006097C998E7}","DisplayName")
if $office
? " Installed "color c+/n"Office Suite" color w/n" is "color w+/n $office color w/n
endif

; ? " Installed "color c+/n"MS Access " color w/n"is version "color w+/n $asr color w/n
; ? " Installed "color c+/n"MS Excel "color w/n"is version " color w+/n "$esr" color w/n
; ? " Installed "color c+/n"MS Outlook " color w/n"is version "color w+/n $osr color w/n
; ? " Installed "color c+/n"MS Powerpoint "color w/n"is version " color w+/n "$psr" color w/n
; ? " Installed "color c+/n"MS Publisher " color w/n"is version "color w+/n $bsr color w/n
; ? " Installed "color c+/n"MS Word " color w/n"is version "color w+/n $wsr color w/n

; ****************************** Configure Outlook ********************************
$MsgKey = "$HKCUSMWNTCV\Windows Messaging Subsystem\Profiles"
$MProfile = ReadValue($MsgKey, "DefaultProfile") ;Read the current default profile
IF $MProfile = "" ;If there is not default profile, create the profile using the PRF
$File = "c:\newprof.PRF" ;Custom profile filename
$exserver = "areamail" ;name of mailserver
DEL "$File" ;Deletes any existing PRF file
copy "$logon\newprof.PRF" "$File" ;Copies baseline PRF file to c:
$section = "General"
$ = WRITEPROFILESTRING ($FILE, $section, "Custom", "1")
$ = WRITEPROFILESTRING ($FILE, $section, "ProfileName", "@UserID")
$ = WRITEPROFILESTRING ($FILE, $section, "DefaultProfile", "Yes")
$ = WRITEPROFILESTRING ($FILE, $section, "OverwriteProfile", "No")
$ = WRITEPROFILESTRING ($FILE, $section, "DefaultStore", "Service2")
$section = "Service List"
$ = WRITEPROFILESTRING ($FILE, $section, "Service1", "Microsoft Outlook Client")
$ = WRITEPROFILESTRING ($FILE, $section, "Service2", "Microsoft Exchange Server")
$ = WRITEPROFILESTRING ($FILE, $section, "Service3", "Outlook Address Book")
$section = "Service2"
$ = WRITEPROFILESTRING ($FILE, $section, "HomeServer", "$exserver")
$ = WRITEPROFILESTRING ($FILE, $section, "MailBoxName", "@userid")
$ = WRITEPROFILESTRING ($FILE, $section, "OfflineAddressBookPath", "%userprofile%\Local Settings\Application Data\Microsoft\Outlook")
$section = "Service3"
$ = WRITEPROFILESTRING ($FILE, $section, "Ben", "True")
$section = "Service4"
$ = WRITEPROFILESTRING ($FILE, $section, "Ben", "True")
SHELL "cmd /c $logon\newprof.exe -P $File -x" ;Creates the Messaging profile
sleep 1
DEL "$File"
DEL "$MSOdir\welcome.msg" ;Delete welcome message file
ENDIF
; ****************************** Adobe Acrobat Reader *****************************************
:acroloop
$acroindex=0
$acroreg=enumkey("$HKLMS\adobe\acrobat reader\",$acroindex)
if @error>0 and $admin=1
shell "cmd /c $setup\apps\acrobat5\setup.exe -s"
sleep 20
$=Writeprofilestring("$logon\inventory\Install.log","Acrobat","@wksta","@date")
endif
$acrodir=readvalue("$hklms\adobe\acrobat reader\$acroreg\InstallPath","")
if exist("$acrodir\AcroRd32.exe")=1
$acrover=getfileversion("$acrodir\AcroRd32.exe")
? " Installed "color c+/n"Acrobat Reader "color w/n"is version " color w+/n $acrover color w/n
if $admin=1 and @ras=0
if ($acrover<$arcurrent and $os="winnt") or ($acrover<"5.0.1.2001032700" and $os="win2k")
$acrounistall=readvalue("$HKLMSMWCV\Uninstall\Adobe Acrobat $acroreg","UninstallString")
shell 'cmd /c "$acrounistall"'
$=Writeprofilestring("$logon\inventory\UnInstall.log","Acrobat $acroreg","@wksta","@date")
if exist ("$setup\apps\acrobat5\setup.exe")
goto acroloop
endif
endif
endif
endif
; ******************************* McAfee VirusShield Section *********************************
; ******* install it
$availver=readprofilestring("$setup\apps\mcafee\install\PkgDesc.ini","VSNT","Version")
if "$availver">"$vscanver"
if updateapp("VirusScan4.5.1",0,1)="yes"
shell ('$setup\apps\mcafee\install\setup.exe reboot=r scanatstartup=false forceinstall=true /qb /i')
$vscanver =readvalue("$NAITVD\VirusScan","szCurrentVersionNumber")
endif
endif
; ******* Service pack it
if "4.5.1.1306">"$vscanver"
if updateapp("VirusScan4.5.1-SP1",0,1)="yes"
shell ('$setup\apps\mcafee\Sp1\VSC451S1.EXE /silent')
$vscanver =readvalue("$NAITVD\VirusScan","szCurrentVersionNumber")
endif
endif
; ******* Superdat it
$availeng=readprofilestring("$setup\apps\mcafee\upgrade\superdat.ini","superdat","Version")
if $availeng > $vscaneng
$=writevalue("$McUpdate\Upgrade\Upgrade Site1","szUNCLocation","$setup\Apps\McAfee\Upgrade",REG_SZ)
shell ('"$mcupdexe/MCUPDATE" /TASK UPGRADE /BATCH /norestart')
$vscaneng =readvalue("$vsengine","szEngineVer")
endif
; ******* dat it
$availdat=dir("$setup\apps\mcafee\update\*.zip")
$availdat=substr("$availdat",5,4)
if instr("$vscandat","$availdat")=0
$=writevalue("$McUpdate\Update\Update Site1","szUNCLocation","$setup\Apps\McAfee\Update",REG_SZ)
shell ('"$mcupdexe/MCUPDATE" /TASK UPDATE /BATCH')
$vsdatdate =readvalue("$vsengine","szDatDate")
$vscandat =readvalue("$vsengine","szDatVersion")
endif
; ******* extra.dat it
FreshFile("$setup\apps\mcafee\update","$vsdatdir","extra.dat")
? " Installed "color c+/n"VirusShield $vscanver "color w/n"is version " color w+/n $vscandat color w/n " dated " color w+/n $vsdatdate color w/n

; ************************************** Elron Section ***************************************
if exist ("@lanroot\elronuam.dll")=0
? " installing Elron "
Shell "$logon\elron\uam_168_82_56_108_53_N.exe"
$=Writeprofilestring("$logon\inventory\Install.log","Elron","@wksta","@date")
endif
; ************************************** Oracle Section ***************************************
; $ora=readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE","ORACLE_HOME")
; $oraver=getfileversion("$ora\bin\n8sw.exe")
; if exist("$ora\bin\n8sw.exe")
; ? " Installed "color c+/n"Oracle "color w/n"version is "color w+/n"$oraver" color w/n
; endif
; ************************************** Winzip Section ***************************************
if existkey("$HKLMSMWCV\App Paths\Winzip32.exe")=0
$zip=readvalue("$HKLMSMWCV\App Paths\Winzip32.exe","")
$Winzipver=getfileversion("$zip")
? " Installed "color c+/n "Winzip "color w/n"version is "color w+/n"$winzipver" color w/n
endif
; ************************************** Chameleon Section ************************************
if exist("c:\netmanag.32\tn3270.exe")
$chamver=getfileversion("c:\netmanag.32\tn3270.exe")
? " Installed "color c+/n "Chameleon "color w/n"version is "color w+/n"$chamver" color w/n
endif
endif
return
;******************************************* end of UpdateApps ***********************************************************
;*************************************************************************************************************************
;******************************************* start of GroupDrives ********************************************************
:GroupDrives
shell "%comspec% /c net use * /delete /y 1>Nul 2>&1"
if ingroup("Areamis")
use f: "$server\e$$"
use Y: "\\ITSS\itss"
? color c+/n " MIS Global Group" color w/n " drives " color w+/n "F: Y:" color w/n
endif
if ingroup("Incidents")
use j: "\\c1dm3\incidents"
? color c+/n " MCHQ Incidents Global Group" color w/n " drives " color w+/n "M:" color w/n
endif
if ingroup("MCHQ_RN")
use m: "\\c1dm3\QOCMonitors"
? color c+/n " QOC Global Group" color w/n " drives " color w+/n "M:" color w/n
endif
if ingroup("Compass")
use i: "\\fdhctlh10\Flstatutes"
? color c+/n " Compass Global Group" color w/n " drives " color w+/n "I:" color w/n
endif
if ingroup("Area_Impromptu")
use e: "\\mad\CAU"
use g: "\\c1dm3\INSP_HQA"
use z: "\\mad\MISAPPS"
? color c+/n " Impromptu Global Group" color w/n " drives " color w+/n "E: G: Z:" color w/n
endif
if ingroup("Area_DMS")
use m: "\\c1dm3\dma$area"
? color c+/n " Disease Management Global Group" color w/n " drives " color w+/n "M:" color w/n
endif
if ingroup("Area_HMO")
use n: "\\c1dm3\hmo"
? color c+/n " HMO WC&C Unit Nurses Global Group" color w/n " drives " color w+/n "N:" color w/n
endif
if ingroup("Area_legal")
use l: "\\itss\pmwin" ; L & M are required for Practice Manager
use m: "\\c1dm3\pmwin"
use t: "\\mad\westpub" ; T & U are required for Premise/Westpub
use u: "\\oagcdwins\ahcce1$$"
use q: "\\fdhctlh10\cch" ; Q, R, & W are required for CCH
use r: "\\fdhctlh10\cchkar02"
use w: "\\fdhctlh10\cchkar03"
use v: "\\mad\shepards" ; V is required for Shepards
? color c+/n " Legal Group"color w/n " drives "color w+/n "Q: R: T: U: V: W:"color w/n
endif
if ingroup("Area_FireSafety") ; MCHQ Fire Safety Surveyors
use f: "\\fdhctlh10\nfc"
? color c+/n " Fire Safety Group"color w/n " drives "color w+/n "F:"color w/n
endif
if ingroup("Area_OIG")
use f: "\\c1dm3\mpi_shared"
use k: "\\c1dm3\adhoc_req"
? color c+/n " OIG Group"color w/n " drives "color w+/n "E: F: K:"color w/n
endif
if ingroup("mpd-area")
use t: "\\c1dm3\mpd_shared"
? color c+/n " Medicaid Field Ops"color w/n " drives "color w+/n "T:"color w/n
endif
if ingroup("adminacts")
use k: "\\mad\adminacts"
? color c+/n " MCHQ Admin Acts database" color w/n " drives "color w+/n "K:"color w/n
endif
Return
;******************************************* end of GroupDrives **********************************************************
;*************************************************************************************************************************
;******************************************* start of GroupApps **********************************************************
:GroupApps
if @ras=0 and $admin=1 and $Location<>"00" ;Do not run section if dialed up or not local admin
; ****************************** FL Legal Research Tools *****************************************
if ingroup("compass")
use i: "\\fdhctlh10\Flstatutes"
if exist("C:\FLTOOLS\BVIEWS.EXE")=0
? " Installing Florida Statutes program"
$Button=Messagebox("The new FL Legal Research Tools are now being installed", "Message from MIS",0)
$Button=Messagebox("You will be required to answer a couple of option windows", "Message from MIS",0)
$Button=Messagebox("Click OK on every option window", "Message from MIS",0)
$Button=Messagebox("The install will start as soon as you close this window", "Message from MIS",0)
shell "i:\comset"
sleep 20
$=Messagebox("Thank You", "Message from MIS",0)
copy "$startmenu\Programs\FL Legal Research Tools\*.*" "$Desktop"
endif
endif

; ******************************* Install Impromptu *********************************
$imp6bindir=readvalue("$HKLMS\Cognos\cer1\Rendition Locations","Programs")
$imp6path="$setup\Apps\impromptu6"
$inf32dir=enumvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Informix\Setup\InstalledDirectories", 0)
if exist("c:\cognos")=1 and ingroup("$group"+"mis")=0 and exist("$inf32dir")=1
? " Removing Old Impromptu"
if exist("$server\hqa\home\@userid")
md "$server\hqa\home\@userid\Impromptu"
endif
copy "c:\cognos\bi96\workspce\*.imr" "$server\hqa\home\@userid\Impromptu"
if @error>0
? " Home dir not found, coping reports to temp folder on C: drive"
md "c:\imrtemp"
copy "c:\cognos\bi96\workspce\*.imr" "c:\imrtemp"
endif
shell "%comspec% /c rd /s /q c:\cognos"
$=delprogramgroup("Cognos",1)
del "$alldesktop\improm~2.lnk"
$=Writeprofilestring("$logon\inventory\unInstall.log","Impromptu","@wksta","@date")
endif

if ingroup("area_impromptu")=1 and exist("C:\Program Files\Cognos\cer1\bin\impuser.exe")=0 and exist("$imp6bindir")=0 and exist("$inf32dir")=1
if updateapp("Impromptu")="yes"
shell "%comspec% /c $imp6path\Cognos\Impromptu\xwsetup.exe /s $imp6path\Cognos\Impromptu\response.ini"
$imp6bindir=readvalue("$HKLMS\Cognos\cer1\Rendition Locations","Programs")
copy "$imp6path\*.ini" "$imp6bindir"
copy "\\mad\misapps\IMPT V6.0\TEMPLA~1\*.*" "C:\Program Files\Cognos\Cer1\bin\User Workspace"
copy "$startmenu\programs\Cognos~1\Cognos~1.lnk" "$desktop"
$=writevalue("$HKCUS\Informix\Environment","DBANSIWARN","n",REG_SZ)
$=writevalue("$HKCUS\Informix\Environment","DELIMIDENT","n",REG_SZ)
$=writevalue("$HKCUS\Informix\Environment","INFORMIXDIR","C:\informix",REG_SZ)
$=writevalue("$HKCUS\Informix\Environment","InformixServer","production",REG_SZ)
$=addkey("$HKCUS\Informix\netrc\ahcaprod")
$=writevalue("$HKCUS\Informix\netrc\ahcaprod","","",REG_SZ)
$=writevalue("$HKCUS\Informix\netrc\ahcaprod","AskPassword","P",REG_SZ)
$=writevalue("$HKCUS\Informix\netrc\ahcaprod","USER","@userid",REG_SZ)
$=addkey("$HKLMS\Informix\SqlHosts")
$=addkey("$HKLMS\Informix\SqlHosts\production")
$=writevalue("$HKLMS\Informix\SqlHosts\production","HOST","ahcaprod",REG_SZ)
$=writevalue("$HKLMS\Informix\SqlHosts\production","PROTOCOL","onsoctcp",REG_SZ)
$=writevalue("$HKLMS\Informix\SqlHosts\production","SERVICE","production",REG_SZ)
$=Writeprofilestring("$logon\inventory\Install.log","Impromptu6","@wksta","@date")
endif
endif
if ingroup("area_impromptu")=0 and ingroup("area_mttadmin")=0 and exist("$imp6bindir")=1 and ingroup("$group"+"mis")=0
? " UnInstalling imp6"
shell '"C:\Program Files\Common Files\Cognos Shared\cer1\Uninstall\uninst.exe" /u "C:\Program Files\Common Files\Cognos Shared\cer1\Uninstall\uninst.ini"'
$=Writeprofilestring("$logon\inventory\UnInstall.log","Impromptu6","@wksta","@date")
$=delprogramgroup("Cognos BI Silent",0)
$=del "$desktop\cognos~1.lnk"
endif

; ************************* Install Metaframe *******************************
;If ingroup("Area_MetaFrame")=1 and exist("C:\PROGRAM FILES\Citrix\ICA CLIENT\Uninst.isu")=0
; if updateapp("Citrix_Metaframe")="yes"
; Shell "\\itss\setupl$\metaframe\Setup.exe -s"
; $=Writeprofilestring("$logon\inventory\Install.log","Metaframe","@wksta","@date")
; sleep 20
; endif
; endif
; ******************* Remove metaframe from unnecessary PCs ******************
If ingroup("Area_MetaFrame")=0 and exist("C:\PROGRAM FILES\Citrix\ICA CLIENT\Uninst.isu")=1 and Ingroup("areamis")=0
? " Uninstalling Citrix Metaframe"
$UnstKey=ReadValue("$HKLMSMWCV\Uninstall\Citrix ICA Client","UninstallString")
Shell "$UnstKey"
$=Writeprofilestring("$logon\inventory\UnInstall.log","Metaframe","@wksta","@date")
endif
; ************************* Install and/or Update QueryPath **************************
If ingroup("Area_QueryPath")=1
$QPexe="C:\Program Files\Consultec\QueryPath\Client.exe"
$QPins=getfileversion("$QPexe")
$QPcurrent="3.4.2.6"
if exist("$QPexe")=1 and $QPins<>$QPcurrent
? " Uninstalling old version of Querypath"
Shell 'cmd /c C:\WINNT\uninst.exe -y -a -f"C:\Program Files\Consultec\QueryPath\DeIsL1.isu" -cC:\PROGRA~1\CONSUL~1\QUERYP~1\_ISREG32.DLL'
endif
if exist("$QPexe")=0
if updateapp("QueryPath")="yes"
Shell "\\lobster\software\QP3.4\Client\Setup.exe -s"
;Shell "regedit /s \\lobster\software\QP3.4\Client\dcom.reg"
$=Writeprofilestring("$logon\inventory\Install.log","QueryPath","@wksta","@date")
$QPins=getfileversion("$QPexe")
endif
endif
? " Installed "color c+/n"QueryPath "color w/n"is version " color w+/n $qpins color w/n
endif
; ********************** Install business Objects ****************************
If ingroup("Area_BusObjects")=1 and exist("C:\Program Files\Business Objects\BusinessObjects 5.0\Busobj.exe")=0
if updateapp("Business_Objects")="yes"
sendmessage("@userid","The Business Objects install will take about 15-20 minutes")
Shell "\\lobster\software\BusObj5\setup\setup.exe -s -skip -key BJ2R-D6RMG-GPKG -rdbmskey H62N-D67U6-PU95"
$=Writeprofilestring("$logon\inventory\Install.log","BusinessObjects","@wksta","@date")
copy "\\lobster\software\BusObj5\security\*.*" "C:\Program Files\Business Objects\BusinessObjects 5.0\LocData"
WshShortCut("$desktop\Business Objects.lnk","C:\Program Files\Business Objects\BusinessObjects 5.0\Busobj.exe")
del "C:\Program Files\Business Objects\BusinessObjects 5.0\Universe\*.unv"
del "C:\Program Files\Business Objects\demo\*.*"
endif
endif
; ************************************** CTS Section *****************************************
$ctspath="C:\Program Files\CTS"
If ingroup("Area_CTS") or exist("C:\Program Files\CTS\CTS.exe")
$CTSfiletime=getfiletime("$ctspath\cts.exe")
; ********************** uninstall CTS **************************
if instr("$CTSfiletime","2002/02/04")=0 and exist("C:\Program Files\CTS\CTS.exe")
$ctsmsi=readvalue("$HKLMSMWCV\Uninstall\{42D79ECA-34FE-4292-9757-5B54EED0766D}","UninstallString")
if "$ctsmsi"
$=deltree("$HKLMSMWCV\installer\Products\ACE97D24EF4329247975B545EE0D67D6")
shell "$ctsmsi /q"
if exist("C:\Program Files\CTS\CTS.exe")
run "$ctsmsi /qr /l* c:\cts.log"
sleep 7
$=setfocus("CTS")
$=sendkeys("i")
sleep 7
endif
else
$=messagebox("CTS needs to be removed to install the new version.@crlfPress YES to uninstall and Remove All if prompted","CTS Removal and Upgrade")
shell 'cmd /c C:\WINNT\st6unst.exe -n "C:\Program Files\CTS\ST6UNST.LOG"'
endif
del "$ctspath\*.*"
$=Writeprofilestring("$logon\inventory\unInstall.log","CTS 4.01","@wksta","@date")
endif
; ********************** Install CTS ****************************
If ingroup("Area_CTS")=1 and exist("$ctspath\CTS.exe")=0
if updateapp("CTS")="yes"
Shell("cmd /c $setup\apps\cts50\cts5.msi")
$=Writeprofilestring("$logon\inventory\Install.log","CTS 5.0","@wksta","@date")
FreshFile("$setup\apps","c:\orant\product\8.1.7\network\admin","tnsnames.ora")
WshShortCut("$desktop\Claims Tracking System.lnk","C:\Program Files\CTS\CTS.exe")
endif
endif
endif

; ************************************** Aspen Section ***************************************
;$asekey="HKEY_LOCAL_MACHINE\SOFTWARE\Alpine Technology Group\ASPEN Survey Explorer"
;$aseinstall="$setup\apps\ase" $asepath="C:\Program Files\ASE"
;if $dept="HQA" or exist("$asepath\ase.exe")=1
; ************************************* ASE 4.0 Upgrade ***************************************
$asefiletime=getfiletime("$asepath\ase.exe")
;if instr("$asefiletime","2001/03/22")=0 and ingroup("area_aco-oracle")=0
;if updateapp("Aspen4.0",3)="yes"
;shell("$aseinstall\setup.exe -s")
;sleep 15
;$=Writeprofilestring("$logon\inventory\Install.log","ASE 4.0","@wksta","@date")
;endif
;endif
; ************************************* ASE 5.1 update ***************************************
; $asefiletime=getfiletime("$asepath\ase.exe")
; if instr("$asefiletime","2002/01/21")=1 and exist("C:\Program Files\ASE\ase.exe")=1
; copy "$setup\apps\ase50\ase.exe" "$asepath"
; copy "$setup\apps\ase50\atgmain8.dll" "$asepath"
; endif
; endif
;********************************* Install OASIS List HHA Reports Plugin ************************
if $dept="HQA"
FreshFile("$setup\apps\OASIS Plugin","C:\Program Files\Internet Explorer\PLUGINS","npdwe70.dll")
endif

; ********************** Install Java JInitiator and Letter Listener ****************************
If exist("c:\Program Files\Oracle\JInitiator 1.1.8.16\bin\jrew.exe")=0
Shell("cmd /c $setup\Apps\JInitiator\MSI\jinitiator16.msi")
$=writevalue("HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\JInitiator","Java Runtime Parameters","-mx64m -Dcache.size=50000000 -Dcache.verbose=true","REG_sz")
endif
;***************************Letter Listener***********************
If ingroup("leletters") and exist("C:\LicenseEase\bin\letterlistener.nt.exe")=0
Shell("cmd /c $setup\Apps\LetterListener\letters.msi")
$=writevalue("HKEY_CURRENT_USER\Control Panel\Desktop","Foregroundlocktimeout","0","REG_DWORD")
endif



endif ; (this endif is for - if @ras=0 and $admin=1)
;********************************* update FMMIS ************************
$consulteccfg="c:\netmanag.32\consultec.cfg"
if exist("$consulteccfg")
$readip=readprofilestring("$consulteccfg","Connection","host")
if $readip="192.168.5.20"
? " Updating FMMIS connection"
$=Writeprofilestring("$consulteccfg","Connection","host","192.168.13.20")
$=Writeprofilestring("$consulteccfg","_Alias_ Atlanta","host","192.168.13.20")
endif
endif
;********************************* update Desktop Shortcuts ************************
select
Case $dept="Medicaid"
if exist("$Favorites\UNITE-Cold.url")=0 WshShortCut("$Favorites\UNITE-Cold.url","http://tlhwebsvr1/html/Base.htm") endif
if exist("$desktop\MedTelTrack.url")=0 WshShortCut("$desktop\MedTelTrack.url","http://ahcaweb/Medtel_track/",,,"C:\WINNT\system32\url.dll,1") endif
if exist("$desktop\FMMIS.lnk")=0 WshShortCut("$desktop\FMMIS.lnk","C:\Netmanag.32\Tn3270.exe",' -F"C:\NETMANAG.32\Consultec.cfg" -C"Atlanta"',"C:\Netmanag.32") endif
if exist("$desktop\Tallahassee.lnk")=0 WshShortCut("$desktop\Tallahassee.lnk","C:\Netmanag.32\Tn3270.exe",' -F"C:\NETMANAG.32\Consultec.cfg" -C"Tallahassee"',"C:\Netmanag.32") endif
Case $dept="HQA"
if exist("$desktop\Oasis Logon.url")=0 WshShortCut("$desktop\Oasis Logon.url","http://oasis/") endif
if exist("$desktop\Aspen Survey Explorer.lnk")=0 WshShortCut("$desktop\Aspen Survey Explorer.lnk","C:\Program Files\Ase\Ase.exe") endif
Case $dept="MIS"
$magic="Magic Total Service Desk"
if exist("$Favorites\$magic.url")=0 WshShortCut("$Favorites\$magic.url","http://magictsd/magictsd/",,,"C:\WINNT\system32\moricons.dll,52") endif
endselect
; Shortcuts for everyone...
$=delvalue("$HKLMS\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00c4F79FAA6}","StubPath")
if exist("$desktop\AHCA WEB.url")=0
copy "\\itss\logon\ahca.ico" "%windir%"
WshShortCut("$desktop\AHCA WEB.url","http://ahcaweb/",,,"%windir%\ahca.ico,0")
endif
if exist("$Favorites\AHCA - TimeDirect.url")=0 WshShortCut("$Favorites\AHCA - TimeDirect.url","http://intra.dms.state.fl.us/tasahca/owa/TASAHCA_WWW.main.main_window",,,"C:\WINNT\system32\moricons.dll,48") endif
if exist("$Favorites\Earnings Statement.url")=0 WshShortCut("$Favorites\Earnings Statement.url","http://flair.dbf.state.fl.us/paypub/earnmain.htm",,,"C:\WINNT\system32\clipbrd.exe,3") endif
if exist("$qlbar\Microsoft Word.lnk")=0 WshShortCut("$qlbar\Microsoft Word.lnk","$MSOdir\Winword.exe") endif
if exist("$qlbar\Microsoft Excel.lnk")=0 WshShortCut("$qlbar\Microsoft Excel.lnk","$MSOdir\Excel.exe") endif
if exist("$qlbar\Launch Outlook Express.lnk") $=SetFileAttr("$qlbar\Launch Outlook Express.lnk", 128) del "$qlbar\Launch Outlook Express.lnk" endif
if exist("$qlbar\Windows Media Player.lnk") del "$qlbar\Windows Media Player.lnk" endif




return
;******************************************* end of GroupApps ************************************************************
;*************************************************************************************************************************
;******************************************* start of Inventory **********************************************************
:Inventory
if @ras=0
if exist("$logon\inventory\@year @month Hardware.csv")=0
if exist("$logon\inventory\Inventory History")=0
shell '%comspec% /c MD "$logon\inventory\Inventory History"'
endif
shell '%comspec% /c MOVE $logon\inventory\*.csv "$logon\inventory\Inventory History\"'
$=Writeprofilestring("$logon\inventory\@year @month Hardware.csv","Hardware Inventory","ComputerName",$c+"Username"+$c+"PositionNumber"+$c+"Department"+$c+"Manufacturer"+$c+"Model"+$c+"Case"+$c+"SerialNumber"+$c+"BiosVersion"+$c+"ProcessorSpeed"+$c+"ProcessorType"+$c+"Dimm1"+$c+"Dimm2"+$c+"Dimm3"+$c+"Modem")
endif
if exist("$logon\inventory\@year @month Software.csv")=0
$=Writeprofilestring("$logon\inventory\@year @month Software.csv","Software Inventory","ComputerName",$c+"Username"+$c+"PositionNumber"+$c+"Department"+$c+"OperatingSystem"+$c+"ServicePack"+$c+"MicrosoftOffice"+$c+"MicrosoftAccess"+$c+"MicrosoftPublisher"+$c+"InternetExplorer"+$c+"McAfeeAntivirus"+$c+"McAfeeEngine"+$c+"McAfeeDAT"+$c+"Oracle"+$c+"Winzip"+$c+"Impromptu"+$c+"Aspen"+$c+"Chameleon")
endif
$=Writeprofilestring("$logon\inventory\@year @month Hardware.csv","Hardware Inventory","@wksta","$c@userid$c$positionnum$c$dept$c$Make$c$Model$c$Case$c$SerNo$c$Biosv$c$CPUsp$c$CPUfm$c$dimm1$c$dimm2$c$dimm3$c$modem")
$=Writeprofilestring("$logon\inventory\@year @month Software.csv","Software Inventory","@wksta","$c@userid$c$positionnum$c$dept$c$os$c@csd$c$esr$c$asr$c$psr$c$ier$c$vscanver$c$vscaneng$c$vscandat$c$OraVer$c$Winzipver$c$Impver$c$asefiletime$c$chamver")
endif

Return
;******************************************* end of Inventory ************************************************************
;*************************************************************************************************************************
; Script does not flow below this section
;*************************************************************************************************************************
;******************************************* start of UDF Functions ******************************************************

;example WshShortCut("%userprofile%\desktop\my notepad.lnk","@lanroot\notepad.exe",,,"@lanroot\shell32.dll,3")
; Used to create new shortcuts and links

Function WshShortCut($path,$targetpath,optional $arguments, optional $startdir, optional $iconpath)
dim $shell,$shortcut,$icosep,$ifile,$iindex
$shell = createobject("wscript.shell")
if $shell
$shortcut = $shell.createshortcut("$path")
if $shortcut $shortcut.targetpath = $targetpath
if $arguments $shortcut.arguments = $arguments endif
if $startdir $shortcut.workingdirectory = $startdir endif
if $iconpath $shortcut.iconlocation = $iconpath endif
$shortcut.save
if instr("$path",".url") and $iconpath
$iloc=split($iconpath,",")
$=writeprofilestring("$path","InternetShortcut","IconFile",$iloc[0])
$=writeprofilestring("$path","InternetShortcut","IconIndex",$iloc[1])
endif
$shortcut = 0
endif
$shell = 0
endif
exit @error
EndFunction

;*************************************************************************************************************************
;example FreshFile("$setup\apps\OASIS Plugin","C:\Program Files\Internet Explorer\PLUGINS","npdwe70.dll")
; used to compare files for updating to newer versions

Function FreshFile($source,$destination,$file)
dim $compare
if exist("$destination\$file")
$compare=comparefiletimes("$source\$file","$destination\$file")
if $compare=1 or $compare=-3
copy "$source\$file" "$destination"
? " Updating $file"
endif
endif
exit @error
EndFunction

;*************************************************************************************************************************
;example $nicarray=Split(WMIQuery("ProductName","Win32_NetworkAdapter"),"|")
; Used to execute a query against WMI. Returns a pipe character delimited string

FUNCTION WMIQuery($what,$where)

dim $strQuery, $objEnumerator, $value
$strQuery = "Select $what From $where"
$SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//@WKSTA&
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66187 - 2002-06-06 04:10 PM Re: My logon Script (caution long lines and post)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
This script is called from the main code for customization for a specific office/location

code:
select
case ingroup($group+"med") MapPrinter("\\a06\Elton",1)
case ingroup($group+"hqa")
case ingroup($group+"mis") MapPrinter("\\wheelerc\printer",1)
case ingroup($group+"mqa") MapPrinter("\\a06\barbrady",1)
case ingroup($group+"oig") MapPrinter("\\a06\elton",1)
use e: "\\fdhctlh03\fmmiscsr"
case 1
sendmessage("@userid","No H: or S: drive will be mapped")
sendmessage("$dcsa","No H: or S: drive was mapped on @userid")
endselect

$h="$server\$dept\home\@userid"
$s="$server\$dept\shared"

if ingroup($group+"mis") $s="$setup" $h="$server\medicaid\home\@userid" endif

if exist("$h")=0
md "$h"
if @error=0
$=sendmessage("$dcsa","Home Folder created at $h for @userid")
; For the cacls statements below to work the user must have
; the CHANGE PERMISSION permission on the home folder root
shell "%comspec% /c echo y| cacls $h /t /c /g fdhc\@userid:c"
shell '%comspec% /c echo y| cacls $h /t /e /c /g "fdhc\domain admins:f"'
shell "%comspec% /c echo y| cacls $h /t /e /c /g fdhc\$group"+"mis:c"
else
$=sendmessage("$dcsa","Home Folder was NOT created at $h for @userid")
endif
endif

select
case $os="WinNT" $subcmd="subst"
case $os="Win2k" $subcmd="net use"
endselect

? " Connecting "color c+/n"H: "color w/n"to "color w+/n $h color w/n
shell "CMD /c $subcmd h: /d 1>Nul 2>&1"
shell "CMD /c $subcmd h: $h 1>Nul 2>&1"

? " Connecting "color c+/n"S: "color w/n"to "color w+/n $s color w/n
shell "CMD /c $subcmd s: /d 1>Nul 2>&1"
shell "CMD /c $subcmd s: $s 1>Nul 2>&1"

if @userid="mcgowann"
use p: "\\c1dm3\pharmacy"
endif


;*******************************************************************
function MapPrinter($printer, Optional $default, optional $oldspool)
DIM $index,$IsInstalled,$lptprinter,$inst_printers,$PrinterPorts,$port_type

$index=0
$IsInstalled=0
$lptprinter=0
$PrinterPorts="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts"

if $oldspool
$=DelPrinterConnection($oldspool)
endif
:loopprinters
$inst_printers=enumvalue($PrinterPorts,$index)
$port_type=readvalue("$PrinterPorts\$inst_printers","$printer")
if @error=0
if $printer=$inst_printers $IsInstalled=1 endif
if instr("$port_type","LPT") $lptprinter=1 endif
$index=$index+1
goto loopprinters
endif
if $IsInstalled=0
$=AddPrinterConnection("$printer")
endif
if $IsInstalled=0 and $lptprinter=0 and $default
$=SetDefaultPrinter("$printer")
endif
endfunction

;*******************************************************************
Function MapDrive($DriveLetter, $UNC, optional $Label, optional $Icon, optional $Delete)
dim $hexchar, $hexlabel, $loop, $subcmd, $os, $labelkey, $keyarray, $labelpath, $di, $timeout

$timeout=0
$labelpath=""
$di="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons"
$labelkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints"

select
Case @producttype = "Windows XP Professional" $os="WinXP" $subcmd="net use"
Case @producttype = "Windows 2000 Professional" $os="Win2K" $subcmd="net use"
Case @producttype = "Windows NT Workstation" $os="WinNT" $subcmd="subst"
endselect

shell '%comspec% /c $subcmd $DriveLetter: /d 1>Nul 2>&1'

if $delete
$=deltree("$labelkey\$DriveLetter")
$=deltree("$di\$DriveLetter")
return
endif

shell '%comspec% /c $subcmd $DriveLetter: "$UNC" 1>Nul 2>&1'
if exist("$DriveLetter:\")=0
return
endif

if $os="Win2k"
if $Label
for $loop = 1 to len($label) ; ******* parse the label and convert to hex string
$hexchar=dectohex(asc(substr("$label",$loop,1)))
$hexlabel=$hexlabel+$hexchar+"00"
next
while len($hexlabel) < 128 ; ******* Buffer the hex string to 128 characters
$hexlabel=$hexlabel+"00"
loop
:waitforreg ; ******* Wait for windows to create the reg keys
$rc=readvalue("$labelkey\$DriveLetter\_LabelFromReg","Cache")
if @error or $rc="" or $timeout<5
$timeout=$timeout+1
sleep(1)
goto waitforreg
endif
$rc=writevalue("$labelkey\$DriveLetter\_LabelFromReg","Version","3",REG_DWORD)
$rc=writevalue("$labelkey\$DriveLetter\_LabelFromReg","Cache","$hexlabel",REG_BINARY)
endif
if $icon ; ******* Maintain custom Icon
$=addkey("$di\$DriveLetter")
$=addkey("$di\$DriveLetter\DefaultIcon")
$=addkey("$di\$DriveLetter\Defaultlabel")
$=writevalue("$di\$DriveLetter\DefaultIcon","","$Icon",REG_SZ)
$=writevalue("$di\$DriveLetter\Defaultlabel","","$Label",REG_SZ)
else
$=deltree("$di\$DriveLetter")
endif
endif
if $os="winxp"
;eventually I will add winxp support...
endif
endfunction

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66188 - 2002-06-06 04:14 PM Re: My logon Script (caution long lines and post)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
and 1000 posts...

Can I retire now? (and there are posers close to 3000, How can I keep this up?)

(also something my wife tells me [Big Grin] )
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66189 - 2002-06-06 04:16 PM Re: My logon Script (caution long lines and post)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Ahh, here we go. I guess i jumped the gun with my first post.
Oh, and with regards to keeping this up, may I suggest those little blue pills [Wink]

Anyway, took a quick look and I would suggest putting some of the stuff in the beginning of your script where you check the gateways and groups into appropriately formatted .INI files for quicker modifications.
Example: GATEWAYS.INI
code:
[164.51.84.129]
Location=01
city=Pensacola
mis=eilandj
[164.51.61.17]
Location=02
city=Panama City
mis=taylorj

GROUPS.INI
code:
[area01]
dcsa=eilandj
dcsaname=Eiland
[area02]
dcsa=taylorj
dcsaname=Taylor
[area51]
dcsa=abuse@cia.gov
dcsaname=Alien Abuse Hotline



[ 06 June 2002, 16:17: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#66190 - 2002-06-06 04:21 PM Re: My logon Script (caution long lines and post)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Could be done.. But I wanted to keep down the number of required files down to a minimum.

I'd rather have 1 big one... and in this case select/endselect manages it well enough
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66191 - 2002-06-06 04:36 PM Re: My logon Script (caution long lines and post)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I prefer .INI files for information lookup which keeps the KiXtart script shorter. But I don't have to worry about bandwidth issues of accessing multiple files.
_________________________
There are two types of vessels, submarines and targets.

Top
#66192 - 2002-06-06 04:42 PM Re: My logon Script (caution long lines and post)
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Wow! I don't think I could ever be bothered to type so much! I've got to start thinking about adding some serious bells and whistles to my logon script now... pictures of dancing girls should do the trick...!

Congrats on the 1000th post, btw. It'll take years for me to get anywhere near that at my current rate of progress - I dunno, don't you guys have anything better to do?! [Big Grin]
_________________________
================================================
Breaker


Top
#66193 - 2002-06-06 04:43 PM Re: My logon Script (caution long lines and post)
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
In my book more small INI files is much preferable than one large one. The reason is that for each read of an INI file the client reads the whole file. That means that if you have a 20K file
and needed to make 100 reads then you have to pull 2 Meg to the client over the network. Each Write means a READ of the whole file then a WRITE of the whole.

[ 06 June 2002, 16:44: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66194 - 2002-06-06 04:43 PM Re: My logon Script (caution long lines and post)
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The other upside of using INI files is you don't need to mucking about in the script as much. Less chance of a misplaced quote or endif blowing it up.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66195 - 2002-06-06 05:22 PM Re: My logon Script (caution long lines and post)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
but then you have RAS clienst trying to read all these files during logon, etc.

They have Kix32 on thier machine and then read 1 (or 2) script files...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.072 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org