Page 1 of 2 12>
Topic Options
#66974 - 2002-06-14 01:41 AM Errors Creating INI and LOG files on WIN95
mschipper Offline
Fresh Scripter

Registered: 2002-05-07
Posts: 10
Loc: Adelaide
Hi There,

I'm having some issues with my script... on Win95 machines it doesnt seem to want to create or edit .INI files or create my DEBUG.LOG file..

Does anyone have any ideas??? I'm really puzzled about this one..

Also, if anyone has any ideas on how i can improve the script.. let me know..

Thanks..
MARK.

code:
; REM ***********************************************************************
; REM **
; REM ** FILE NAME: Logon.KIX
; REM ** LOCATION : \NETLOGON\SCRIPTS
; REM ** DEVELOPER: Mark Schipper - mark.schipper@polyaire.com.au
; REM ** PURPOSE : Automate some client and admin tasks, as well as enforce
; REM ** some polyaire system standards. Displays security and
; REM ** logging message. Syncs time of local computer with logon
; REM ** server, configures outlook profile. Maps user's home and project directories.
; REM ** Verify the local client network configuration, as well as
; REM ** keep anti-virus signatures up-to-date.
; REM **
; REM ***********************************************************************


; REM ** Patches

$NT4SP6_Patch = "" ; REM ** Windows NT4 SP6 Patch
$NT4SP6AD_Patch = "" ; REM ** Windows NT4 SP6 (With ACTIVE DESKTOP) Patch
$W98_Patch = "" ; REM ** Windows 98 Patch
$W95_Patch = "" ; REM ** Windows 95 Patch
$W95AD_Patch = "" ; REM ** Windows 95 Patch (With ACTIVE DESKTOP) Patch
$W2K_Patch = "" ; REM ** Windows 2K Patch
$IE_Patch = "" ; REM ** Internet Explorer Patch *** Checks for Correct Version

; REM ** Establish variables, constants.

$CurrentDat = "4207xdat.exe" ; REM ** Current Mcafee XDAT/SDAT file
$Hoffpdc = "10.5.1.2" ; REM ** HOFFPDC IP
$Hoffrad = "10.5.1.3" ; REM ** HOFFRAD IP
$Hoffexc = "10.5.1.4" ; REM ** HOFFEXC IP
$Mbank = "10.2.1.2" ; REM ** MBANK IP
$Ttown = "10.3.1.2" ; REM ** TTOWN IP
$Ctarf = "10.4.1.2" ; REM ** CTARF IP
$Bwater = "10.6.1.2" ; REM ** BWATER IP
$DomainName = "polyaire.com.au" ; REM ** Corporate Domain
$SysDrive = (SubStr(%windir%,1,2)) ; REM ** Where is the OS installed? Win95/98 don't support %SystemDrive%
$AcceptKey = "B" ; REM ** Key pressed to accept Security Warning Message
$AdminEmail = "helpdesk@@"+"$DomainName" ; REM ** Where to send all of the warning messages
$DaysSince1970 = ((((@YEAR - 1970) * 365) + @YDAYNO) + ((@YEAR - 1972) / 4))
$DebugFile = "$SysDrive\@LDOMAIN\Debug.Log" ; REM ** Location of the script debug log
$DisplayWarning = "No" ; REM ** Do we need to show the Security Warning message
$EmailMessage = " " ; REM ** Message sent to the $AdminEmail address
$ErrorNumber = 0 ; REM ** Holder for Kix32 Error number
$ErrorString = " " ; REM ** Holder for Kix32 Error string
$INIFile = "$SysDrive\@LDOMAIN\@LDOMAIN.INI" ; REM ** INI file used for script settings and event checking
$PatchFile = "$SysDrive\@LDOMAIN\PATCH.INI" ; REM ** INI file used for patch history checking
$MailServer = "hoffexc" ; REM ** POP3 mail server
$OS = "UnKnown" ; REM ** What OS is the client system?
$Privilege = "User" ; REM ** User's priviledge level
$Reboot = "No" ; REM ** Reason for rebooting the user's computer
$Row = 4 ; REM ** What row to place the cursor on
$Status = " " ; REM ** Reused throughout the script for status messages
$TempKey = " " ; REM ** Used to capture key pressed during Security Message
$TempNumber = 0 ; REM ** Reused throughout the script for several functions
$TempString = " " ; REM ** Reused throughout the script for several functions
$EmailName = Replace(@FULLNAME," ",".") ; REM ** Gather First part of user email address
$UserEmail = "$EmailName"+"@@"+"$DomainName" ; REM ** User's email address in mixed case
$HomeSvr = SubStr("@HOMESHR",3,(Len(@HOMESHR) - Len("\USERS")) - 2) ; REM ** User's Local Server
$Datapath = "$SysDrive"+"\"+"@LDOMAIN"+"\" ; REM ** name of your local datapath


; REM ***********************************************************************
; REM **
; REM ** Begin execution at the main() function at the bottom of the script
; REM ** file. Sue me, I still have this habit from old 'c' classes. :^)
; REM **
; REM ***********************************************************************

Goto Main


:DisplayError
; REM ***********************************************************************
; REM **
; REM ** Display an error box on the local screen, and send a message to
; REM ** one of the NT administrators to let him know. Depending on the
; REM ** number of errors occured, you may want to remark out the
; REM ** 'SENDMESSAGE' line or it could be annoying.
; REM **
; REM ***********************************************************************

Beep
$ErrorNumber = @ERROR
$ErrorString = @SERROR
MessageBox ("$ErrorNumber : $ErrorString", "Script Processing Error. A system administrator has been notified.", 4144, 30)
$EmailMessage = "Script Processing Error $ErrorNumber ($ErrorString) occured at @TIME while @FULLNAME was logging in from @WKSTA."
$Dummy = WriteLine (10, $EmailMessage + Chr(13) + Chr(10))
Gosub SendAdminMail
Return


:GetDebugInfo
; REM ************************************************************************
; REM **
; REM ** Extra info about the client system.
; REM **
; REM ************************************************************************
$IP00 = TrimIP(@IPaddress0)
$IP01 = TrimIP(@IPaddress1)
$IP02 = TrimIP(@IPaddress2)
$IP03 = TrimIP(@IPaddress3)

$TempString =
"KiX Information ----------------------------" + Chr(13) + Chr(10) +
"KiX Version : @KIX" + Chr(13) + Chr(10) +
"KiX RPC Server : @RSERVER" + Chr(13) + Chr(10) +
"Script Directory : @SCRIPTDIR" + Chr(13) + Chr(10) +
"Start Dir for KiX : @STARTDIR" + Chr(13) + Chr(10) +
"Network Information ------------------------" + Chr(13) + Chr(10) +
"Logon Domain : @LDOMAIN" + Chr(13) + Chr(10) +
"Logon Server : @LSERVER" + Chr(13) + Chr(10) +
"Logon Drive Ltr : @LDRIVE" + Chr(13) + Chr(10) +
"Home Server : $HomeSvr" + Chr(13) + Chr(10) +
"Computer Name : @WKSTA" + Chr(13) + Chr(10) +
"IP Hostname : @HOSTNAME" + Chr(13) + Chr(10) +
"IP Address #1 : $IP00" + Chr(13) + Chr(10) +
" #2 : $IP01" + Chr(13) + Chr(10) +
" #3 : $IP02" + Chr(13) + Chr(10) +
" #4 : $IP03" + Chr(13) + Chr(10) +
"Ethernet Address : @ADDRESS" + Chr(13) + Chr(10) +
"Client Information -------------------------" + Chr(13) + Chr(10) +
"Logon Name : @USERID" + Chr(13) + Chr(10) +
"Users Name : @FULLNAME" + Chr(13) + Chr(10) +
"Users Email : $UserEmail" + Chr(13) + Chr(10) +
"Operating System : @ProductType" + Chr(13) + Chr(10) +
"O/S Version : @DOS" + Chr(13) + Chr(10) +
"OS Root Directory : %SYSTEMROOT%" + Chr(13) + Chr(10) +
"Local User Access : $Privilege" + Chr(13) + Chr(10) +
"Password Age : @PWAGE Days" + Chr(13) + Chr(10) +
"User Profile Path : %USERPROFILE%" + Chr(13) + Chr(10)
Return


:SendAdminMail
; REM ************************************************************************
; REM **
; REM ** Used to send email to the NT Administrator defined in $AdminEmail.
; REM ** Attaches a copy of the local $DebugFile to the message so we can see
; REM ** if there's a history of problems on the machine.
; REM **
; REM ** Interprets the user's email address from their logon name. Both
; REM ** logon names as well as email addresses are based on the employee's
; REM ** insurance (employee) number.
; REM **
; REM ************************************************************************

Gosub GetDebugInfo
$PostieLoc = "$Datapath"+"POSTIE.exe"
$PostieRem = "@LDRIVE"+"POSTIE.exe"
$PostieParam = " -host:$MailServer -to:$AdminEmail -from:$UserEmail -s:Logon_Script_Error_on_@WKSTA
-msg:" + Chr(34) + "$TempString $EmailMessage" + Chr(34) + " -q -a:$DebugFile"

If NOT Exist($PostieLoc)
Copy $PostieRem $PostieLoc
EndIf
Run "$PostieLoc"+"$PostieParam"
Return


:RandomKey
; REM ************************************************************************
; REM **
; REM ** Used to generate a "random" $AcceptKey.
; REM **
; REM ************************************************************************

SRND (Val(SubStr(@TIME, 7, 2)) * 1000)
$AcceptKey = Chr((Rnd (25)) + 65)
Return


:DrawHeaderBox
; REM ***********************************************************************
; REM **
; REM ** Draw header box at top of screen. The color used to draw the screen
; REM ** changes depending on the user's privilege level.
; REM **
; REM ***********************************************************************

Select
Case ($DisplayWarning = "Yes") OR ($Privilege = "Domain Admin")
Color w+/r
Case $Privilege = "Local Admin"
Color w+/g
Case 1
Color w+/b
EndSelect
CLS
Box (0,0,2,79,DOUBLE)
$TempString = "@LDOMAIN Windows NT Domain"
AT (1,(39 - (Len($TempString) / 2))) $TempString
Return


:VerifyInitialSetup
; REM ***********************************************************************
; REM **
; REM ** This routine verifies that the local computer has the '@LDOMAIN'
; REM ** directory created on it. This directory is used to store debugging
; REM ** information, as well as configuration information.
; REM ** This routine also opens the debug log file, so it is possible to
; REM ** trace through the log and see where (if) the script fails.
; REM ** Checks to see what OS the client is running.
; REM ** In addition, the script checks to see if you have ever seen the
; REM ** security warning / logging message (on a new system setup for
; REM ** instance), or if it is the 1st day of the month.
; REM ** Finally, this script checks to see if you are a member of the
; REM ** 'Domain Admins' group and sets the '$Privilege' variable
; REM ** accordingly.
; REM **
; REM ***********************************************************************
$Rollover = "NO"

If (Exist("$Datapath"+"Debug.log") <> 0)
$DebugSize = GetFileSize("$Datapath"+"Debug.log")
If $Debugsize >= "150000"
$fileDate = replace(@DATE,"/","")
$Rollover = "YES"
Copy "$Datapath"+"Debug.log" "$Datapath"+"$fileDate"+"-Debug.log"
Del "$Datapath"+"Debug.log"
EndIf
EndIf

If (Exist ($INIFile) <> 1)
MD "$SysDrive\@LDOMAIN"
If @Error <> 0
$EmailMessage = "Could not create @LDOMAIN directory on @WKSTA. Please check immediately!"
Gosub SendAdminMail
MessageBox ("There is an error in your system configuration that is preventing you from being logged onto the
network succesfully. Please contact IT support for assistance.","Notice",4112)
EndIf
$DisplayWarning = "Yes"
EndIf
$Dummy = Open (10, $DebugFile, 5)
If $Rollover <> "NO"
$Dummy = WriteLine (10, "*** Debug.log rolled over to $fileDate-Debug.log" + Chr(13) + Chr(10))
EndIf
$Dummy = WriteLine (10, "*** Debug Log Started @TIME @DATE." + Chr(13) + Chr(10))
$Dummy = WriteLine (10, "@FULLNAME logged in as @USERID to @WKSTA." + Chr(13) + Chr(10))
Select
Case (@ProductType = "Windows 2000 Professional") ; REM ** What OS are we running?
$OS = "Win2K"
Case (@ProductType = "Windows NT Workstation")
$OS = "WinNT4"
Case (@ProductType = "Windows 98")
$OS = "Win98"
Case (@ProductType = "Windows 95")
$OS = "Win95"
EndSelect

If ($DisplayWarning = "No") ; REM ** Should we really show the security message?
If (@MDAYNO = 1)
If (ReadProfileString ($INIFile, "LastSeen", "SecurityMessage") <> $DaysSince1970)
$DisplayWarning = "Yes"
EndIf
Else
If (($DaysSince1970 - ReadProfileString ($INIFile, "LastSeen", "SecurityMessage")) >= 1)
$DisplayWarning = "Yes"
EndIf
EndIf
EndIf
Select ; REM ** What is the user's privilege level?
Case InGroup("Domain Admins")
$Privilege = "Domain Admin"
Case InGroup("\\@WKSTA\Administrators")
$Privilege = "Local Admin"
Case InGroup("\\@WKSTA\Power Users")
$Privilege = "Power User"
Case 1
$Privilege = "User"
EndSelect
Return


:DrawSecurityBox
; REM ***********************************************************************
; REM **
; REM ** Display security information box to local user, as well as make a
; REM ** copy on their local system.
; REM **
; REM ***********************************************************************

AT (7,9) "Use of Polyaire IT facilities is governed by the IT procedures"
AT (8,30) "and applicable laws."
AT (12,2) "Your activity on IT facilities may be monitored. All files including email"
AT (13,2) "and Internet are Polyaire business records. Business records"
AT (14,2) "may be accessed by Polyaire at random without your consent. Improper"
AT (15,2) "use of IT facilities may result in disciplinary action and legal liability."
Gosub RandomKey
Sleep 3
Box (22,0,24,78,SINGLE)
AT (23,14) "Press the -< "
Color w+/r+
AT (23,27) "$AcceptKey"
Color w+/r
AT (23,28) " >- button to indicate your acceptance."
FlushKB
$Dummy = SetConsole ("FOREGROUND")
Do
Get $TempKey
Until Ucase($TempKey) = $AcceptKey
; REM ** Create 'hardcopy' of warning on local computer.
$TempString = "$SysDrive\@LDOMAIN\Security.Txt"
If (Exist ($TempString) = 1)
If Open (1, $TempString, 4) = 0
$Dummy = WriteLine (1, "@FULLNAME (@USERID - @WKSTA) Re-Acknowledged Information at @TIME on @DATE." + Chr(13) + Chr(10))
$Dummy = Close (1)
Else
Gosub DisplayError
EndIf
Else
If (Open (1, $TempString, 5) = 0)
$Dummy = WriteLine (1, "@LDOMAIN Windows NT Domain" + Chr(13) + Chr(10))
$Dummy = WriteLine (1, Chr(13) + Chr(10))
$Dummy = WriteLine (1, "Use of Polyaire IT facilities is governed by the IT procedures" + Chr(13) + Chr(10))
$Dummy = WriteLine (1, "and applicable laws." + Chr(13) + Chr(10))
$Dummy = WriteLine (1, Chr(13) + Chr(10))
$Dummy = WriteLine (1, "Your activity on IT facilities may be monitored. All files including email" + Chr(13) + Chr(10))
$Dummy = WriteLine (1, "and Internet are Polyaire business records. Business records" + Chr(13) + Chr(10))
$Dummy = WriteLine (1, "may be accessed by Polyaire at random without your consent. Improper" + Chr(13) + Chr(10))
$Dummy = WriteLine (1, "use of IT facilities may result in disciplinary action and legal liability." + Chr(13) + Chr(10))
$Dummy = WriteLine (1, Chr(13) + Chr(10))
$Dummy = WriteLine (1, "If you now continue use of the system, you expressly consent to these" + Chr(13) + Chr(10))
$Dummy = WriteLine (1, "conditions of use." + Chr(13) + Chr(10))
$Dummy = WriteLine (1, Chr(13) + Chr(10))
$Dummy = WriteLine (1, "This message was last displayed to @FULLNAME (@USERID) at @TIME on @DATE." + Chr(13) + Chr(10))
$Dummy = WriteLine (1, Chr(13) + Chr(10))
$Dummy = Close (1)
Else
Gosub DisplayError
EndIf
EndIf
$Dummy = WriteProfileString ($INIFile, "LastSeen", "SecurityMessage", "$DaysSince1970")
$Dummy = WriteLine (10, "Displayed Security / Logging Warning Message to @FULLNAME (@USERID)." + Chr(13) + Chr(10))
$DisplayWarning = "No"
Return


:SyncTime
; REM ***********************************************************************
; REM **
; REM ** Syncronize the local system time with the logon server. The PDC
; REM ** server DOM01 syncronizes with NTP server gatekeeper.kodak.com in
; REM ** Rochester, and then acts as an NTP server to BDC DOM02-DOM04 itself.
; REM ** The NT servers must be set in the registry to act as a time server
; REM ** for the NT workstations, otherwise this won't work.
; REM **
; REM ***********************************************************************

If ((($OS = "WinNT4") OR ($OS = "Win2K")) AND ($Privilege = "User")))
$Dummy = WriteLine (10, "User does not have permissions to set local clock." + Chr(13) + Chr(10))
Return
EndIf
SetTime "\\$HomeSvr"
If (@ERROR <> 0)
Gosub DisplayError
$Status = " Error "
Else
$Dummy = WriteLine (10, "Syncronized local time with logon server." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
EndIf
Return


:CheckDNS
; REM ***********************************************************************
; REM **
; REM ** Checks to make sure that the DNS settings are correct. If they are
; REM ** found to be incorrect the script edits the registery to insert the
; REM ** correct values. If the script has problems doing so (general error,
; REM ** user dosen't have rights to modify the registry, etc.) a message
; REM ** is sent to the system administrators alerting them to this fact.
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:
$DNS = " "

; REM ** Checks to see which Control Set is Current
If ($OS = "WinNT4")
$TempNumber = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\Select", "Current")
$TempString = "ControlSet00"+$TempNumber
EndIf

; REM ** Finds the DNS Server Settings
Select
Case $OS = "WinNT4"
$DNS = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\Tcpip\Parameters", "NameServer")
Case (($OS = "Win95") OR ($OS = "Win98"))
$DNS = ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "NameServer")
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting DNS verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect

; REM ** Checks the DNS Settings and updates if necessary
Select
Case $OS = "WinNT4"
If $DNS = "$hoffpdc $hoffrad"
$Dummy = WriteLine (10, "Verified DNS Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else ; REM ** Sets the DNS settings correct if they are not
$Dummy = WriteLine (10, "Old DNS Information: $DNS" + Chr(13) + Chr(10))
If (($Privilege = "Domain Admin") OR ($Privilege = "Local Admin"))
$Dummy = WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\Tcpip\Parameters", "NameServer", "$Hoffpdc $Hoffrad", "REG_SZ")
$Reboot = "DNS"
$Dummy = WriteLine (10, "Updated DNS Settings." + Chr(13) + Chr(10))
$Status = "Updated "
Else
$EmailMessage = "@WKSTA (@FULLNAME) has incorrect DNS Settings. The current settings are $DNS. Please correct the settings on this system."
Gosub SendAdminMail
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
MessageBox ("Your DNS settings are INCORRECT but could not be changed automatically. A systems administrator has been notified of the problem.","Notice",4144)
$Status = "Skipped "
EndIf
EndIf
Case (($OS = "Win95") OR ($OS = "Win98"))
If $DNS = "$hoffpdc,$hoffrad"
$Dummy = WriteLine (10, "Verified DNS Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else ; REM ** Sets the DNS settings correct if they are not
$Dummy = WriteLine (10, "Old DNS Information: $DNS" + Chr(13) + Chr(10))
$Dummy = WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "NameServer", "$hoffpdc,$hoffrad", "REG_SZ")
$Reboot = "DNS"
$Dummy = WriteLine (10, "Updated DNS Settings." + Chr(13) + Chr(10))
$Status = "Updated "
EndIf
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting DNS verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect
Return


:CheckDNSDomain
; REM ***********************************************************************
; REM **
; REM ** Checks to make sure that DNS domain setting is correct. If
; REM ** incorrect, the script edits the registery to insert the
; REM ** correct value. If the script has problems doing so (general error,
; REM ** user dosen't have rights to modify the registry, etc.) a message
; REM ** is sent to the system administrators alerting them to this fact.
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:
$Domain = " "

; REM ** Checks to see which Control Set is Current
If ($OS = "WinNT4")
$TempNumber = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\Select\", "Current")
$TempString = "ControlSet00"+$TempNumber
EndIf

; REM ** Finds the DNS Domain Settings
Select
Case $OS = "WinNT4"
$Domain = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\Tcpip\Parameters", "Domain")
Case (($OS = "Win95") OR ($OS = "Win98"))
$Domain = ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "Domain")
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting DNS Domain verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect

; REM ** Checks the DNS Domain Setting and updates if necessary
Select
Case $OS = "WinNT4"
If $Domain = $DomainName
$Dummy = WriteLine (10, "Verified DNS Domain Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else ; REM ** Sets the DNS Domain settings correct if they are not
$Dummy = WriteLine (10, "Old DNS Domain Information: $Domain" + Chr(13) + Chr(10))
If (($Privilege = "Domain Admin") OR ($Privilege = "Local Admin"))
$Dummy = WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\Tcpip\Parameters", "Domain", $DomainName, "REG_SZ")
$Reboot = "DNS Domain"
$Dummy = WriteLine (10, "Updated DNS Domain Settings." + Chr(13) + Chr(10))
$TempString = "Updated "
Else
$EmailMessage = "@WKSTA (@FULLNAME) has incorrect DNS Domain Settings. The current settings are $Domain. Please correct the settings on this system."
Gosub SendAdminMail
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
MessageBox ("Your DNS Domain settings are INCORRECT but could not be changed automatically. A systems administrator has been notified of the problem.","Notice",4144)
$Status = "Skipped "
EndIf
EndIf
Case (($OS = "Win95") OR ($OS = "Win98"))
If $Domain = $DomainName
$Dummy = WriteLine (10, "Verified DNS Domain Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else ; REM ** Sets the DNS settings correct if they are not
$Dummy = WriteLine (10, "Old DNS Domain Information: $Domain" + Chr(13) + Chr(10))
$Dummy = WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "Domain", $DomainName, "REG_SZ")
$Reboot = "DNS Domain"
$Dummy = WriteLine (10, "Updated DNS Domain Settings." + Chr(13) + Chr(10))
$Status = "Updated "
EndIf
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting DNS Domain verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect
Return


:CheckDNSSearch
; REM ***********************************************************************
; REM **
; REM ** Checks to make sure that DNS suffix search order is correct. If
; REM ** incorrect, the script edits the registery to insert the
; REM ** correct value. If the script has problems doing so (general error,
; REM ** user dosen't have rights to modify the registry, etc.) a message
; REM ** is sent to the system administrators alerting them to this fact.
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:
$Domain = " "

; REM ** Checks to see which Control Set is Current
If ($OS = "WinNT4")
$TempNumber = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\Select\", "Current")
$TempString = "ControlSet00"+$TempNumber
EndIf

; REM ** Finds the DNS Search Order
Select
Case $OS = "WinNT4"
$Domain = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\Tcpip\Parameters", "SearchList")
Case (($OS = "Win95") OR ($OS = "Win98"))
$Domain = ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "SearchList")
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting DNS Suffix Search Order verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect

; REM ** Checks the DNS Suffix Search Order and updates if necessary
Select
Case $OS = "WinNT4"
If $Domain = $DomainName
$Dummy = WriteLine (10, "Verified DNS Suffix Search Order." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else ; REM ** Sets the DNS Domain settings correct if they are not
$Dummy = WriteLine (10, "Old DNS Suffix Search Order Information: $Domain" + Chr(13) + Chr(10))
If (($Privilege = "Domain Admin") OR ($Privilege = "Local Admin"))
$Dummy = WriteValue ("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\Tcpip\Parameters", "SearchList", $DomainName, "REG_SZ")
$Reboot = "DNS Search Order"
$Dummy = WriteLine (10, "Updated DNS Suffix Search Order." + Chr(13) + Chr(10))
$Status = "Updated "
Else
$EmailMessage = "@WKSTA (@FULLNAME) has incorrect DNS Suffix Search Order Settings. The current settings are $Domain. Please correct the settings on this system."
Gosub SendAdminMail
$Dummy = WriteLine (10, "$EmailMesssage" + Chr(13) + Chr(10))
MessageBox ("Your DNS Search Order settings are INCORRECT but could not be changed automatically. A systems administrator has been notified of the problem.","Notice",4144)
$Status = "Skipped "
EndIf
EndIf
Case (($OS = "Win95") OR ($OS = "Win98"))
If $Domain = $DomainName
$Dummy = WriteLine (10, "Verified DNS Suffix Search Order." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else ; REM ** Sets the DNS settings correct if they are not
$Dummy = WriteLine (10, "Old DNS Suffix Search Order Information: $Domain" + Chr(13) + Chr(10))
$Dummy = WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "SearchList", $DomainName, "REG_SZ")
$Reboot = "DNS Search Order"
$Dummy = WriteLine (10, "Updated DNS Suffix Search Order." + Chr(13) + Chr(10))
$Status = "Updated "
EndIf
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting DNS Suffix Search Order verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect
Return


:CheckWINS
; REM ***********************************************************************
; REM **
; REM ** Checks to make sure that the WINS settings are correct. If they are
; REM ** found to be incorrect the script edits the registry to insert the
; REM ** correct values. If the script has problems doing so (general error,
; REM ** user dosen't have rights to modify the registry, etc.) a message
; REM ** is sent to the system administrators alerting them to this fact.
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:
$NetCard = " "
$WINS1 = " "
$WINS2 = " "

Select
Case Ucase($Homesvr) = "HOFFPDC"
$Site1 = $Hoffpdc
$Site2 = $Hoffrad
Case Ucase($Homesvr) = "MBANK"
$Site1 = $Mbank
$Site2 = $Hoffpdc
Case Ucase($Homesvr) = "CTARF"
$Site1 = $Ctarf
$Site2 = $Hoffpdc
Case Ucase($Homesvr) = "TTOWN"
$Site1 = $Ttown
$Site2 = $Hoffpdc
Case Ucase($Homesvr) = "BWATER"
$Site1 = $Bwater
$Site2 = $Hoffpdc
Case 1
$EmailMessage = "@WKSTA (@FULLNAME) Can't determine HOME SERVER. The current settings $homesvr. Please correct the settings on this system."
Gosub SendAdminMail
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
MessageBox ("The logon script could not determine your home server. A systems administrator has been notified of the problem.","Notice",4144)
$Status = "Skipped "
Return
EndSelect

; REM ** Checks to see which ControlSet and Network Card is Current
If ($OS = "WinNT4")
$TempNumber = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\Select", "Current")
$TempString = "ControlSet00"+$TempNumber
$NetCard = EnumKey("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\NetBT\Adapters",0)
EndIf

; REM ** Finds the WINS Server Settings
Select
Case $OS = "WinNT4"
$WINS1 = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\NetBT\Adapters\$NetCard", "NameServer")
$WINS2 = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\NetBT\Adapters\$NetCard", "NameServerBackup")
Case (($OS = "Win95") OR ($OS = "Win98"))
$WINS1 = ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "NameServer1")
$WINS2 = ReadValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "NameServer2")
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting WINS verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect

; REM ** Checks the WINS Settings
If (($WINS1 = $Site1) AND ($WINS2 = $Site2))
$Dummy = WriteLine (10, "Verified WINS Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else
; REM ** Sets the WINS settings correct if they are not
$Dummy = WriteLine (10, "Old WINS Information: $WINS1 $WINS2" + Chr(13) + Chr(10))
Select
Case $OS = "WinNT4"
If (($Privilege = "Domain Admin") OR ($Privilege = "Local Admin"))
$Dummy = WriteValue("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\NetBT\Adapters\$NetCard", "NameServer", $Site1, "REG_SZ")
$Dummy = WriteValue("HKEY_LOCAL_MACHINE\SYSTEM\$TempString\Services\NetBT\Adapters\$NetCard", "NameServerBackup", $Site2, "REG_SZ")
$Reboot = "WINS"
$Dummy = WriteLine (10, "Updated WINS Settings" + Chr(13) + Chr(10))
$Status = "Updated "
Else ;REM ** IF not correct then sends an alert.
$EmailMessage = "@WKSTA (@FULLNAME) has incorrect WINS Settings. The current settings are $WINS1 and $WINS2. Please correct the settings on this system."
Gosub SendAdminMail
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
MessageBox ("Your WINS settings are INCORRECT but could not be changed automatically. A systems administrator has been notified of the problem.","Notice",4144)
$Status = "Skipped "
EndIf
Case (($OS = "Win95") OR ($OS = "Win98"))
$Dummy = WriteValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "NameServer1", $Site1, "REG_SZ")
$Dummy = WriteValue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP", "NameServer2", $Site2, "REG_SZ")
$Reboot = "WINS"
$Dummy = WriteLine (10, "Updated WINS Settings" + Chr(13) + Chr(10))
$Status = "Updated "
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting WINS verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect
EndIf
Return


:CheckIESettings
; REM ***********************************************************************
; REM **
; REM ** Checks to make sure that Internet Explorer is correct. If incorrect, the
; REM ** script edits the registery to insert the correct value. If the
; REM ** script has problems doing so (general error, user doesn't have
; REM ** rights to modify the registry, etc.) a message is sent to the system
; REM ** administrators alerting them to this fact.
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:
$IEProxy = " "

; REM ** Finds the IE Settings
Select
Case (($OS = "WinNT4") OR ($OS = "Win2k"))
$IEProxy = ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer")
Case (($OS = "Win95") OR ($OS = "Win98"))
$IEProxy = ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer")
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting Internet Explorer verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect

; REM ** Checks IE Settings
If ($IEProxy = "hoffexc:80")
$Dummy = WriteLine (10, "Verified IE Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Else
; REM ** Sets the IE settings correct If they are NOT
$Dummy = WriteLine (10, "IE Settings Not Current" + Chr(13) + Chr(10))
Select
Case (($OS = "WinNT4") OR ($OS = "Win2K"))
If (($Privilege = "Domain Admin") OR ($Privilege = "Local Admin"))
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyHttp1.1", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "EnableHttp1.1", "00000000", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "MigrateProxy", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "hoffexc:80", "REG_MULTI_SZ")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride", "<local>", "REG_MULTI_SZ")
$Reboot = "IE Settings"
$Dummy = WriteLine (10, "Updated Internet Explorer Settings" + Chr(13) + Chr(10))
$Status = "Updated "
Else ;REM ** IF not correct then sends an alert.
$EmailMessage = "@WKSTA (@FULLNAME) has incorrect Internet Explorer Settings. The current setting is $IEProxy. Please correct the settings on this system."
Gosub SendAdminMail
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
MessageBox ("Your Internet Explorer settings are INCORRECT but could not be changed automatically. A systems administrator has been notified of the problem.","Notice",4144)
$Status = "Skipped "
EndIf
Case (($OS = "Win95") OR ($OS = "Win98"))
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyHttp1.1", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "EnableHttp1.1", "00000000", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "MigrateProxy", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "hoffexc:80", "REG_SZ")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride", "<local>", "REG_SZ")
$Reboot = "IE Settings"
$Dummy = WriteLine (10, "Updated Internet Explorer Settings" + Chr(13) + Chr(10))
$Status = "Updated "
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting Internet Explorer verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect
EndIf
Return


:CheckPasswordCaching
; REM ***********************************************************************
; REM **
; REM ** Checks to see if the user has a password caching is disabled.
; REM **
; REM ***********************************************************************

Select
Case (($OS = "WinNT4") OR ($OS = "Win2k"))
$Dummy = WriteLine (10, "$OS Does not require password caching to be disabled." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Case (($OS = "Win95") OR ($OS = "Win98"))
$Cache = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\NETWORK", "DisablePwdCaching")
If $Cache <> "1"
KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\NETWORK")
If @ERROR = 0
Goto NOPWD
Else
Goto CONT
EndIf
Else
$Dummy = WriteLine (10, "Verified Password Caching Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
EndIf
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting password caching verification." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect
Return

:CONT
KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES")
If @ERROR = 0
Goto NETWORK
Else
AddKey("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES")
EndIf

:NETWORK
KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\NETWORK")
If @ERROR = 0
Goto NOPWD
Else
AddKey("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\NETWORK")
EndIf
Goto NOPWD

:NOPWD
? "Adding no password cache"
KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\NETWORK")
If @ERROR = 0
; ? "Updating No password cache"
WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\POLICIES\NETWORK", "DisablePwdCaching","1","REG_SZ")
$Dummy = WriteLine (10, "Disabled Password Caching." + Chr(13) + Chr(10))
$Status = "Updated "
Else
EndIf
Return


:ConfOutlook
; REM ***********************************************************************
; REM **
; REM ** Checks to see if the user has a outlook profile on the local
; REM ** system, and if not creates it.
; REM **
; REM ***********************************************************************
$hklms = 'HKEY_LOCAL_MACHINE\SOFTWARE'
$hkcus = 'HKEY_CURRENT_USER\SOFTWARE'
$Profile_Remove = "No" ; -- If set to Yes, it will remove profiles other than @USERID, like OEM User, MS Exchange Settings, etc.
$DeleteItems = "Yes" ; -- Do you want your users to delete all deleted items on Exit from Outlook?
$exserver = " "
$Profname = SubStr(@FULLNAME,1,1)+" "+SubStr(@FULLNAME,InStr(@FULLNAME," ")+1,1) ; -- Get User Initials

Select
Case Ucase($Homesvr) = "HOFFPDC"
$Exserver = $Hoffexc
Case Ucase($Homesvr) = "MBANK"
$Exserver = $Mbank
Case Ucase($Homesvr) = "CTARF"
$Exserver = $Ctarf
Case Ucase($Homesvr) = "TTOWN"
$Exserver = $Ttown
Case Ucase($Homesvr) = "BWATER"
$Exserver = $Bwater
Case 1
$EmailMessage = "@WKSTA (@FULLNAME) Can't determine HOME SERVER. The current settings $homesvr. Please correct the settings on this system."
Gosub SendAdminMail
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
MessageBox ("The logon script could not determine your home server. A systems administrator has been notified of the problem.","Notice",4144)
$Status = "Skipped "
Return
EndSelect

Select
Case (($OS = "WinNT4") OR ($OS = "Win2k"))
$profilelocation = $hkcus+"\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
If 1 <> Exist("%userprofile%"+"\WINNT.PRF")
Copy @LDRIVE+"Winnt.prf" "%userprofile%\WINNT.PRF"
EndIf
$winntfile = "%UserProfile%\Winnt.prf"
Case (($OS = "Win95") OR ($OS = "Win98"))
$profilelocation = $hkcus+"\Microsoft\Windows Messaging Subsystem\Profiles"
If 1 <> Exist("%userprofile%"+"\WINNT.PRF")
Copy @LDRIVE+"Winnt.prf" "%windir%\WIN95.PRF"
EndIf
$winntfile = "%Windir%\Win95.prf"
Case 1
$Dummy = WriteLine (10, "Unknown operating system, aborting outlook configuration." + Chr(13) + Chr(10))
$Status = "Aborted "
Return
EndSelect
$personalprofilelocation = $profilelocation+"\"+"$Profname"

; -- Now that we have created the appropriate Keys and Registry Values, Let's Generate the user's Profile
;If 1 <> Exist("$Datapath\PROFGEN.exe")
; Copy @LDRIVE+"PROFGEN.EXE" "$Datapath"+"PROFGEN.EXE"
;EndIf
If 1 <> Exist("$Datapath\NEWPROF.EXE")
Copy @LDRIVE+"NEWPROF.EXE" "$Datapath"+"NEWPROF.EXE"
EndIf
If 1 <> Exist("$Datapath\FixPrf.exe")
Copy @LDRIVE+"FixPrf.exe" "$Datapath"+"FixPrf.exe"
EndIf

; -- If we open WINNT.PRF in a TEXT Editor,
; -- we notice that it is structured the same as an INI file

$profilename = ReadProfileString($winntfile,"General","ProfileName")

If $profilename <> "$Profname"
$ = WriteProfileString($winntfile,"General","ProfileName",Chr(37)+"$Profname"+Chr(37))
EndIf

If $exserver <> ReadProfileString($winntfile,"Service2","HomeServer")
$ = WriteProfileString($winntfile,"Service2","HomeServer",$exserver)
EndIf

$mailboxname = ReadProfileString($winntfile,"Service2","MailboxName")

If $mailboxname <> "@userid" OR $mailboxname = "$USERNAME$"
$ = WriteProfileString($winntfile,"Service2","MailboxName",Chr(37)+"username"+Chr(37))
EndIf

; -- If the userid exists, we don't want to mess with it
If 1 = KeyExist( $personalprofilelocation )
$Dummy = WriteLine (10, "Verified Outlook Profile Settings." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Return
EndIf

If $Profile_Remove = "YES"
; -- If it does not exist, delete out any odd-ball Profiles
; -- Like OEM user, etc.
$index = 0
:loop3
$keyname = EnumKey($profilelocation, $index)
If @error = 0
;? "Name found: $KeyName" ; -- Uncomment for debugging
; -- Going to check for @userid
If $keyname <> @userid OR $keyname <> "Sales"
$rc = DelTree($profilelocation+"\"+$keyname)
;$RC = DELKEY($ProfileLocation, $KeyName)
$index = $index + 1
Goto Loop3
EndIf
EndIf
EndIf

; -- Generate the Inbox
; -- Make sure you use PUTINENV.EXE and WINSET.EXE with 9x machines - We need to have the %USERNAME% available
; -- "Secondary Inbox" is an alternate to keep
$returncode= KeyExist($personalprofilelocation); OR KeyExist($profilelocation+"\Secondary Inbox")
;?$ReturnCode ; -- Uncomment for debugging
If $returncode <> 1
;Edit the copied mail profile to make it the userid.
;run "%WINDIR%\fixpatch.exe @USERID"
;The quotes here are important with Windows 2000 Machines as the user profile is
;under \DOCUMENTS AND SETTTINGS\USERID and KIX appears to not like spaces in file/folder names
$Fixprf = "$Datapath"+"Fixprf.exe"
Run '$Fixprf "$winntfile" @userid "$Profname" $ExServer'
; -- Had to add a small pause
Sleep 1
$Newprof = "$Datapath"+"Newprof.exe"
Run '$Newprof -p "$winntfile" -x'
;If you want to use PROFGEN, uncomment the next line and comment the one for FIXPRF.EXE
;RUN '%WINDIR%\PROFGEN.EXE %WINDIR%\NEWPROF.EXE -P "%UserProfile%\WINNT.PRF" @userid -r -l'

;Write new default mail profile based on USERID
;Had to add a small pause for this next step
Sleep 1
$ = WriteValue($profilelocation, "DefaultProfile", "$Profname", "REG_SZ")
EndIf

; -- Check for the Default profile, if it does not exist, create it
If @userid <> ReadValue( $profilelocation, "DefaultProfile" )
$ = WriteValue ($profilelocation, "DefaultProfile", "$Profname", "REG_SZ")
EndIf

; -- Check the box to empty deleted items on leaving Outlook - Now the we have the Outlook Profile Generated
If $DeleteItems = "Yes"
If "0100" <> ReadValue($personalprofilelocation+
"\0a0d020000000000c000000000000046","000b0115")
$ = WriteValue($personalprofilelocation+
"\0a0d020000000000c000000000000046","000b0115","0100","REG_BINARY")
EndIf
EndIf

If 1 <> KeyExist($personalprofilelocation)

; -- Check for Outlook Version 9.x (Office 2000)
$exe=ReadValue($hklms+"\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE","")
$ver=GetFileVersion("$exe")

$verchk = SubStr ($ver, 1, 1)

If $verchk = "9" ; -- If it is Outlook 2000, configure the following keys and values

; -- CHECK FOR KEYS AND IF NEED BE, ADD THEM
If 1 <> KeyExist($hkcus+"\Microsoft\Office\9.0")
$ = AddKey($hkcus+"\Microsoft\Office\9.0")
EndIf

If 1 <> KeyExist($hkcus+"\Microsoft\Office\9.0\Common")
$ = AddKey($hkcus+"\Microsoft\Office\9.0\Common")
EndIf

If 1 <> KeyExist($hkcus+"\Microsoft\Office\9.0\Common\UserInfo")
$ = AddKey($hkcus+"\Microsoft\Office\9.0\Common\UserInfo")
EndIf

If 1 <> KeyExist($hkcus+"\Microsoft\Office\9.0\Outlook")
$ = AddKey($hkcus+"\Microsoft\Office\9.0\Outlook")
EndIf

If 1 <> KeyExist($hkcus+"\Microsoft\Office\9.0\Outlook\Setup")
$ = AddKey($hkcus+"\Microsoft\Office\9.0\Outlook\Setup")
EndIf

If 1 <> KeyExist($hkcus+"\Microsoft\Office\9.0\Outlook\Office Explorer")
$ = AddKey($hkcus+"\Microsoft\Office\9.0\Outlook\Office Explorer")
EndIf

; -- NEW KEYS

; -- Company

;$ = WriteValue($hkcus+"\Microsoft\Office\9.0\Common\UserInfo","Company",
"0000000000000000000000000000000000000000000000000000000000000000000000000","REG_BINARY")

; -- Changes the view to get rid of the Outlook Bar and show the "Explorer View"
;$ = WriteValue($hkcus+"\Microsoft\Office\9.0\Outlook\Office Explorer","Frame",
"010000002c0000000200000003000000ffffffffffffffffffffffffffffffff62000000270000003c030000ac02000001000000000000000100000000000000c0000000
6400000003000000","REG_BI NARY")

; -- Set the Machine Name
If @WKSTA <> ReadValue($hkcus+"\Microsoft\Office\9.0\Outlook","Machine Name")
$ = WriteValue($hkcus+"\Microsoft\Office\9.0\Outlook","Machine Name",@WKSTA,"REG_SZ")
EndIf

; -- Check Internet E-Mail Accounts
If 1 <> ReadValue($hkcus+"\Microsoft\Office\9.0\Outlook","CheckInternetAccounts")
$ = WriteValue($hkcus+"\Microsoft\Office\9.0\Outlook","CheckInternetAccounts","1","REG_DWORD")
EndIf

; -- Mail Type - is it Corporate or POP3?
If 1 <> ReadValue($hkcus+"\Microsoft\Office\9.0\Outlook\Setup","MailSupport")
$ = WriteValue($hkcus+"\Microsoft\Office\9.0\Outlook\Setup","MailSupport","1","REG_DWORD")
EndIf

; -- Has Outlook been Setup?
If "False" <> ReadValue($hkcus+"\Microsoft\Office\9.0\Outlook","FirstRunDialog")
$ = WriteValue($hkcus+"\Microsoft\Office\9.0\Outlook","FirstRunDialog","False","REG_SZ")
EndIf
EndIf
EndIf
$Dummy = WriteLine (10, "Outlook Configured for @USERID on @WKSTA." + Chr(13) + Chr(10))
$Status = "Updated "
Return


:CheckMcAfee
; REM ***********************************************************************
; REM **
; REM ** Checks to see if McAfee anti-virus is installed and if the virus
; REM ** signatures are the most current.
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:

$AVCurrentVersion="4.5.1" ; REM ** Current version of anti-virus software
$AVVersion = " " ; REM ** Currently installed version of anti-virus software
$SourceDat = "@LDRIVE"+"$CurrentDat"
$DestDat = "$Datapath"+"$CurrentDat"
$TempStr = " "

If (KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan") = 1)
$AVVersion =ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan", "szCurrentVersionNumber")
Else
$EmailMessage = "@USERID (@FULLNAME) on computer @WKSTA needs to have Mcafee anti-virus installed."
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
Gosub SendAdminMail
$Status = "Skipped "
Return
EndIf
If ($AVVersion = $AVCurrentVersion) ; REM ** Don't update the local signatures if the client software hasn't been updated yet.
$TempString = Exist($DestDat)
Select
Case $TempString = 1
$Dummy = WriteLine (10, "Verified Mcafee anti-virus signature version." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Case $TempString = 0
$EmailMessage = "@USERID on computer @WKSTA has a old version of Mcafee anti-virus signatures (Copy $SourceDat $DestDat)"
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
Del "$Datapath"+"*xdat.exe"
Del "$Datapath"+"sdat*.exe"
Copy $SourceDat $DestDat
Run "$DestDat /SILENT /PROMPT"
$Status = "Updated "
Case 1 ; REM ** This will also copy the updates if the update file is not found on the local client system.
$Dummy = WriteLine (10, "Mcafee anti-virus signatures are uptodate." + Chr(13) + Chr(10))
$Status = "Skipped "
EndSelect
Else
$EmailMessage = "@USERID (@FULLNAME) on computer @WKSTA needs to have Mcafee anti-virus software updated from v$AVVersion to v$AVCurrentVersion."
$Dummy = WriteLine (10, "$EmailMessage" + Chr(13) + Chr(10))
Gosub SendAdminMail
$Status = "Skipped "
EndIf
Return


:CheckTemp
; REM ***********************************************************************
; REM **
; REM ** Checks to see if Temp direectory is installed and if it needs clearing
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:
$tempdir = "$Datapath"+"\"+"temp1.dat"
$tempfile = "$Datapath"+"\"+"temp2.dat"
Dim $tempdir_data[99999]

Shell "%comspec% /c dir %temp% /ad /b /s > $tempdir"
Shell "%comspec% /c dir %temp% /a-d /b /s > $tempfile"

; **REM Kill_Files
$q = Open(1,$tempfile)
$tempfile_data = ReadLine(1)
While @error = 0
Del $tempfile_data
$tempfile_data = ReadLine(1)
Loop
$q = Close(1)

; **REM Kill_directories
$array_count = 0
$q = Open (1,$tempdir)
$tempdir_data[$array_count] = ReadLine(1)

While $tempdir_data[$array_count] <> ""
$array_count = $array_count + 1
$tempdir_data[$array_count] = ReadLine(1)
Loop
$q = Close(1)

RD $tempdir_data[$array_count]
While $array_count >= 0
RD $tempdir_data[$array_count]
$array_count = $array_count - 1
Loop

Del $tempdir
Del $tempfile

$Dummy = WriteLine (10, "Verified Temp Directory is clear." + Chr(13) + Chr(10))
$Status = " " + Chr(251) + " OK "
Return


:Patch
; REM ***********************************************************************
; REM **
; REM ** Checks to see if the OS needs any patches installed
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:


If (Exist ($PatchFile) <> 1)
MD "$SysDrive\@LDOMAIN\Patch"
MD "$SysDrive\@LDOMAIN\Patch\$OS"
MD "$SysDrive\@LDOMAIN\Patch\IE"
If @Error <> 0
$EmailMessage = "Could not create PATCH directory's on @WKSTA. Please check immediately!"
Gosub SendAdminMail
MessageBox ("There is an error in your system configuration that is preventing you from being logged onto the
network succesfully. Please contact IT support for assistance.","Notice",4112)
EndIf
EndIf

$ADInstalled = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\
{89820200-ECBD-11cf-8B85-00AA005B4395}", "IsInstalled")
Select
Case $OS = "WINNT"
If $ADIntalled = 1
$OSPatch = $NT4SP6AD_Patch
$SourcePatch = "@LDRIVE"+"Patch"+"\"+"$OSAD"+"\"+"$OSPatch"
$DestPatch = "$DataPath"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
Else
$OSPatch = $NT4SP6_Patch
$SourcePatch = "@LDRIVE"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
$DestPatch = "$DataPath"+"Patch"
Top
#66975 - 2002-06-14 02:14 AM Re: Errors Creating INI and LOG files on WIN95
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
HAve you thought of trying a pared down test script? That's what I do.

I'm way WAY W A Y too lazy to pour over all that. Maybe one of the new moderators will pickup the challenge. [Wink]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66976 - 2002-06-14 02:20 AM Re: Errors Creating INI and LOG files on WIN95
mschipper Offline
Fresh Scripter

Registered: 2002-05-07
Posts: 10
Loc: Adelaide
Hi There,

Yeah i have cut it down and done heaps of testing. I still cant find the error.. I havnt used kixtart for long.. only about a month.

I changed the script yesterday so it emails me whenever this error occurs (can create directories, files, etc) and so far ive had 13 emails sent to me.. all from Win95 machines.

I think im going insane.. [Smile]

Thanks.
MARK.

Top
#66977 - 2002-06-14 02:27 AM Re: Errors Creating INI and LOG files on WIN95
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hello mschipper,

My recommendation would be to go to MCA's site and try out his KIXSTRIP tool for the version of the KiXtart you're using.

MCA's website (good scripts and tools)

I often feel sorry for new comers and will try to go the extra mile where I can, but as Les says... this is TOO much code to manually sift through for errors when it is not on your own system.

Top
#66978 - 2002-06-14 02:33 AM Re: Errors Creating INI and LOG files on WIN95
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
You have quite an involved script... Not bad, lots of logging.

I have 1 suggestion however, that that is instead of haveing several sections each with an NT section and a 95 section, I'd have a big 95 section with all the little routines in it, and then the NT/2k section with all of it's parameters.... perhaps even in seperate files.

It helps tremendously in T/S and face it, eventually everyone will get away from wintendo. Maybe not today, and maybe not next year, but it will be done...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66979 - 2002-06-14 02:34 AM Re: Errors Creating INI and LOG files on WIN95
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
perhaps it you isolated the error to a region of only a few thousand lines of code... [Smile]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66980 - 2002-06-14 02:41 AM Re: Errors Creating INI and LOG files on WIN95
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Found one small error. Typo, $ADIntalled should be $ADInstalled. Not the source of you problem however. Double check all the file handles for starters.

I'm guessing that it is an intermittent problem and not repeatable. Could be a case of file contention. may want to put your Open() in a countdown loop to retry.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66981 - 2002-06-14 02:55 AM Re: Errors Creating INI and LOG files on WIN95
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Reading the script will also be easier if you consolidate some stuff into UDFs.

I also highly recommend to use either KIXStrip from MCA's website or put a DEBUG ON in the first lne of the script. Then run the script from one of the affected Windows 9x computers and step though it. This will most likely show you where the problem is.

Oh, finally, what are the error messages that you get mailed?
_________________________
There are two types of vessels, submarines and targets.

Top
#66982 - 2002-06-14 02:58 AM Re: Errors Creating INI and LOG files on WIN95
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Mark, the first suggestion I have, after a quick scan of your programming style, is that you should lookup WriteLog() and WriteLog2() in the UDF Library. These UDF's will make your logging tasks much cleaner.

Can you give me specific files names that are not getting written properly. Can you further refine what is not happing correctly? How often? Are these files that are not getting written to all local to each computer or are they on a network drive? Are any of these files shared or written to by more than one computer? If so, how many?mant?

[ 14 June 2002, 03:07: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66983 - 2002-06-14 03:05 AM Re: Errors Creating INI and LOG files on WIN95
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I also see a great deal of repeatative text that could be consolidated greatly reducing the size of your script and potentially improving readability.
For example you use long registry keys repeatedly. Try using a variable.

instead of:
code:
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyHttp1.1", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "EnableHttp1.1", "00000000", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "MigrateProxy", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "hoffexc:80", "REG_MULTI_SZ")

use
code:
$Key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

one time and reference $Key in multiple lines.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66984 - 2002-06-14 03:14 AM Re: Errors Creating INI and LOG files on WIN95
mschipper Offline
Fresh Scripter

Registered: 2002-05-07
Posts: 10
Loc: Adelaide
Thanks for those tips.. [Smile]

I like the idea of UDF's but am having some issues getting my head around them..

I ran the KIXSTRIP400 program over the script and only came up with one error.. in my SYNCTIME sub. Which i fixed.. although i dont think that was the problem im addressing here..

Here is where i think the problem is:

code:
 :verifyinitialsetup
; REM ***********************************************************************
; REM **
; REM ** This routine verifies that the local computer has the '@LDOMAIN'
; REM ** directory created on it. This directory is used to store debugging
; REM ** information, as well as configuration information.
; REM ** This routine also opens the debug log file, so it is possible to
; REM ** trace through the log and see where (if) the script fails.
; REM ** Checks to see what OS the client is running.
; REM ** In addition, the script checks to see if you have ever seen the
; REM ** security warning / logging message (on a new system setup for
; REM ** instance), or if it is the 1st day of the month.
; REM ** Finally, this script checks to see if you are a member of the
; REM ** 'Domain Admins' group and sets the '$Privilege' variable
; REM ** accordingly.
; REM **
; REM ***********************************************************************
$rollover = "NO"

IF (Exist("$Datapath"+"Debug.log") <> 0)
$debugsize = GetFileSize("$Datapath"+"Debug.log")
IF $debugsize >= "150000"
$filedate = replace(@date,"/","")
$rollover = "YES"
COPY "$Datapath"+"Debug.log" "$Datapath"+"$fileDate"+"-Debug.log"
DEL "$Datapath"+"Debug.log"
ENDIF
ENDIF

IF (Exist ($inifile) <> 1)
MD "$SysDrive\@LDOMAIN"
IF @error <> 0
$emailmessage = "Could not create @LDOMAIN directory on @WKSTA. Please check immediately!"
GOSUB SendAdminMail
MessageBox ("There is an error in your system configuration that is preventing you from being logged onto the
network succesfully. Please contact IT support for assistance.","Notice",4112)
ENDIF
$displaywarning = "Yes"
ENDIF
$dummy = Open (10, $debugfile, 5)
IF $rollover <> "NO"
$dummy = WriteLine (10, "*** Debug.log rolled over to $fileDate-Debug.log" + Chr(13) + Chr(10))
ENDIF
$dummy = WriteLine (10, "*** Debug Log Started @TIME @DATE." + Chr(13) + Chr(10))
$dummy = WriteLine (10, "@FULLNAME logged in as @USERID to @WKSTA." + Chr(13) + Chr(10))
SELECT
CASE
(@producttype = "Windows 2000 Professional") ; REM ** What OS are we running?
$os = "Win2K"
CASE
(@producttype = "Windows NT Workstation")
$os = "WinNT4"
CASE
(@producttype = "Windows 98")
$os = "Win98"
CASE
(@producttype = "Windows 95")
$os = "Win95"
ENDSELECT

IF ($displaywarning = "No") ; REM ** Should we really show the security message?
IF (@mdayno = 1)
IF (ReadProfileString ($inifile, "LastSeen", "SecurityMessage") <> $dayssince1970)
$displaywarning = "Yes"
ENDIF
ELSE
IF (($dayssince1970 - ReadProfileString ($inifile, "LastSeen", "SecurityMessage")) >= 1)
$displaywarning = "Yes"
ENDIF
ENDIF
ENDIF
SELECT ; REM ** What is the user's privilege level?
CASE
InGroup("Domain Admins")
$privilege = "Domain Admin"
CASE
InGroup("\\@WKSTA\Administrators")
$privilege = "Local Admin"
CASE
InGroup("\\@WKSTA\Power Users")
$privilege = "Power User"
CASE
1
$privilege = "User"
ENDSELECT
RETURN



and.......

code:
 :patch
; REM ***********************************************************************
; REM **
; REM ** Checks to see if the OS needs any patches installed
; REM **
; REM ***********************************************************************
; REM ** Local variables in use by this function are:


IF (Exist ($patchfile) <> 1)
MD "$SysDrive\@LDOMAIN\Patch"
MD "$SysDrive\@LDOMAIN\Patch\$OS"
MD "$SysDrive\@LDOMAIN\Patch\IE"
IF @error <> 0
$emailmessage = "Could not create PATCH directory's on @WKSTA. Please check immediately!"
GOSUB SendAdminMail
MessageBox ("There is an error in your system configuration that is preventing you from being logged onto the network succesfully. Please contact IT support for assistance.","Notice",4112)
ENDIF
ENDIF

$adinstalled = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4395}", "IsInstalled")
SELECT
CASE
$os = "WINNT"
IF $adinstalled = 1
$ospatch = $nt4sp6ad_patch
$sourcepatch = "@LDRIVE"+"Patch"+"\"+"$OSAD"+"\"+"$OSPatch"
$destpatch = "$DataPath"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
ELSE
$ospatch = $nt4sp6_patch
$sourcepatch = "@LDRIVE"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
$destpatch = "$DataPath"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
ENDIF
CASE
$os = "WIN98"
$ospatch = $w98_patch
$sourcepatch = "@LDRIVE"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
$destpatch = "$DataPath"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
CASE
$os = "WIN95"
IF $adinstalled = 1
$ospatch = $w95ad_patch
$sourcepatch = "@LDRIVE"+"Patch"+"\"+"$OSAD"+"\"+"$OSPatch"
$destpatch = "$DataPath"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
ELSE
$ospatch = $w95_patch
$sourcepatch = "@LDRIVE"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
$destpatch = "$DataPath"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
ENDIF
CASE
$os = "WIN2K"
$ospatch = $w2k_patch
$sourcepatch = "@LDRIVE"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
$destpatch = "$DataPath"+"Patch"+"\"+"$OS"+"\"+"$OSPatch"
CASE
1
$dummy = WriteLine (10, "Unknown operating system, aborting outlook configuration." + Chr(13) + Chr(10))
$status = "Aborted "
RETURN
ENDSELECT

$status = " " + Chr(251) + " OK "

IF $ospatch <> ""
IF (ReadProfileString ($patchfile, "$OS", "$OSPatch") <> DONE)
COPY $sourcepatch $destpatch
RUN "$DestPatch /Q"
$dummy = WriteProfileString ($patchfile, "$OS", "$OSPatch", "DONE")
$dummy = WriteLine (10, "$OS Patch ($OSPatch) has been installed on @WKSTA" + Chr(13) + Chr(10))
$status = "Updated "
ENDIF
ENDIF

IF ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer", "Version") = "5.50.4807.2300"
IF $ie_patch <> ""
IF (ReadProfileString ($patchfile, "IE", "$IE_Patch") <> DONE)
$sourcepatch = "@LDRIVE"+"Patch"+"IE"+"\"+"$IE_Patch"
$destpatch = "$DataPath"+"Patch"+"IE"+"\"+"$IE_Patch"
COPY $sourcepatch $destpatch
RUN "$DestPatch /Q"
$dummy = WriteProfileString ($patchfile, "IE", "$IE_Patch", "DONE")
$dummy = WriteLine (10, "Internet Explorer Patch ($OSPatch) has been installed on @WKSTA" + Chr(13) + Chr(10))
$status = "Updated "
ENDIF
ENDIF
ENDIF
RETURN



The email i receive (two of them generated from these areas of code) are:

Could not create PATCH directory's on USER. Please check immediately!

and...

Could not create POLYAIRE directory on USER. Please check immediately!

Thanks again.
MARK.

[ 14 June 2002, 04:55: Message edited by: mschipper ]

Top
#66985 - 2002-06-14 03:21 AM Re: Errors Creating INI and LOG files on WIN95
mschipper Offline
Fresh Scripter

Registered: 2002-05-07
Posts: 10
Loc: Adelaide
The thing is when i check each workstation the directories (that are reported as not being created) are there.. but the files that they check for

POLYAIRE.INI and PATCH.INI are not created.

Also the file DEBUG.LOG isnt created on these machines also..

Thanks.

Top
#66986 - 2002-06-14 03:27 AM Re: Errors Creating INI and LOG files on WIN95
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I could find no reference to the creation of a directory Polyaire, but I did see that when creating the "Patch" directory you use @LDomain. This macro depends when run on a Win9x computer depends on the KXRPC service to acquire this logon domain name. I recommend that you change the name of the directory of all loggin directory to something that does not require the use of @Ldomain. The reason being that if the client failes to fill the value of @LDomain for whatever reason, network, missing or stopped KXRPX service, or just a flaky client, your logging is directly affected.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66987 - 2002-06-14 03:31 AM Re: Errors Creating INI and LOG files on WIN95
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
mschipper, could you please edit your first post and break the three longest lines using a CR. Doing so would aloww the page width for these posts to be narrower. The loonnnggg lines inside the code tags cause these super-wide pages.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66988 - 2002-06-14 03:40 AM Re: Errors Creating INI and LOG files on WIN95
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the first error...
there is no patch dir created.
if md sets the error then the error is from the last md not from all.
anyway, you could/should also post the error reporter by kix.
nicely done by adding to old error:
"...error: @serror"

and howard stated it nicely.
does it work if you change it not to have this @ldomain macro?
_________________________
!

download KiXnet

Top
#66989 - 2002-06-14 03:53 AM Re: Errors Creating INI and LOG files on WIN95
mschipper Offline
Fresh Scripter

Registered: 2002-05-07
Posts: 10
Loc: Adelaide
HURRAY!!

Yes the @LDOMAIN was the problem..

I added a variable $LDir instead of @LDOMAIN and it works a treat.. [Smile]

You guys rock..

MARK.

Top
#66990 - 2002-06-14 04:17 AM Re: Errors Creating INI and LOG files on WIN95
mschipper Offline
Fresh Scripter

Registered: 2002-05-07
Posts: 10
Loc: Adelaide
On a side note..

I cant seem to edit my posts on the forum... I get a "PAGE COULD NOT BE DISPLAYED" error when i click EDIT REPLY from the edit page.. [Frown]

MARK.

Top
#66991 - 2002-06-14 04:22 AM Re: Errors Creating INI and LOG files on WIN95
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
click the "page & pencil" icon just above the top of the post you wan to edit. If you hold the cursor over each icon popup help text will appear after a moment.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#66992 - 2002-06-14 04:36 AM Re: Errors Creating INI and LOG files on WIN95
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might want to assing your macros (@LDOMAIN) to variables in the beginning of the script. This way you can check for a correct value just in that one place.

Oh, yes, and consolidate, consolidate, consolidate. My rule of thumb is, if I do something at least twice, it justifies a UDF. Using UDFs will also simplify debugging because you have less code to check where an error might be introduced.
_________________________
There are two types of vessels, submarines and targets.

Top
#66993 - 2002-06-14 04:38 AM Re: Errors Creating INI and LOG files on WIN95
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Jens, sorry for hijacking - you got mail !

[ 14 June 2002, 04:38: Message edited by: Shawn ]

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.146 seconds in which 0.094 seconds were spent on a total of 13 queries. Zlib compression enabled.

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