Try downloading the latest version of Sanity from my web site. Doc posted the UDF for me here on KORG and I can't edit it.

You might also want to do it all in a local folder instead of over the network to the netlogon share!

When I run
 Code:
Call '.\Sanity.KXF'
Sanity('yourscript.kix', 'report.txt')

I get
 Code:
          
Warning: Undeclared variable.
              Variable Name: $
                In function: Main
         Referenced on line: 2
          
Warning: Undeclared variable.
              Variable Name: $osname
                In function: Main
         Referenced on line: 4
          
Warning: Undeclared variable.
              Variable Name: $vista
                In function: Main
         Referenced on line: 5
          
Warning: Undeclared variable.
              Variable Name: $logfilepath
                In function: Main
         Referenced on line: 8
          
Warning: Undeclared variable.
              Variable Name: $inifile
                In function: Main
         Referenced on line: 9
          
Warning: Undeclared variable.
              Variable Name: $personal_loc
                In function: Main
         Referenced on line: 15
          
Warning: Undeclared variable.
              Variable Name: $desktop_loc
                In function: Main
         Referenced on line: 16
          
Warning: Undeclared variable.
              Variable Name: $start_loc
                In function: Main
         Referenced on line: 17
          
Warning: Variable referenced inside string.
              Variable Name: $
                In function: Main
         Referenced on line: 41
     41: RUN "\\srv05wts\keyfinder\keyfinder.exe /save \\srv05wts\logs$\ /close"
          
Warning: Undeclared variable.
              Variable Name: $count
                In function: ENUMINI
         Referenced on line: 75
          
Warning: Undeclared variable.
              Variable Name: $personal_loc
                In function: run_functions
         Referenced on line: 112
          
Warning: Undeclared variable.
              Variable Name: $desktop_loc
                In function: run_functions
         Referenced on line: 112
          
Warning: Undeclared variable.
              Variable Name: $start_loc
                In function: run_functions
         Referenced on line: 112
          
Warning: Variable referenced inside string.
              Variable Name: $command2
                In function: run_functions
         Referenced on line: 119
    119: RUN "$command2$command"
          
Warning: Undeclared variable.
              Variable Name: $
                In function: copy_files
         Referenced on line: 143
          
Warning: Variable referenced inside string.
              Variable Name: $
                In function: copy_files
         Referenced on line: 143
    143: $file=$server + "icons$\" + $program
          
Warning: Variable referenced inside string.
              Variable Name: $personal
                In function: copy_files
         Referenced on line: 147
    147: if not exist ("$personal$program")
          
Warning: Variable referenced inside string.
              Variable Name: $file
                In function: copy_files
         Referenced on line: 150
    150: error_check(@ERROR,@SERROR,"couldnt copy $file to $personal")
          
Warning: Variable referenced inside string.
              Variable Name: $desktop
                In function: copy_files
         Referenced on line: 152
    152: if not exist ("$desktop$program")
          
Warning: Variable referenced inside string.
              Variable Name: $file
                In function: copy_files
         Referenced on line: 155
    155: error_check(@ERROR,@SERROR,"couldnt copy $file to $desktop")
          
Warning: Variable referenced inside string.
              Variable Name: $start
                In function: copy_files
         Referenced on line: 160
    160: if not exist ("$start$program")
          
Warning: Variable referenced inside string.
              Variable Name: $file
                In function: copy_files
         Referenced on line: 163
    163: error_check(@ERROR,@SERROR,"couldnt copy $file to $start")
          
Warning: Variable referenced inside string.
              Variable Name: $server
                In function: drive_mapping
         Referenced on line: 178
    178: $share="$server$share"
          
Warning: Variable referenced inside string.
              Variable Name: $drive
                In function: drive_mapping
         Referenced on line: 181
    181: ? "mapping $drive to $share"
          
Warning: Undeclared variable.
              Variable Name: $drive:
                In function: drive_mapping
         Referenced on line: 182
          
Warning: Variable referenced inside string.
              Variable Name: $drive
                In function: drive_mapping
         Referenced on line: 184
    184: error_check(@ERROR,@SERROR,"failed to remove $drive drive")
          
Warning: Variable referenced inside string.
              Variable Name: $drive
                In function: drive_mapping
         Referenced on line: 188
    188: error_check(@ERROR,@SERROR,"failed to map $drive drive")
          
Warning: Variable referenced inside string.
              Variable Name: $server
                In function: printer_mapping
         Referenced on line: 205
    205: If AddPrinterConnection("$server$printer")=0
          
Warning: Variable referenced inside string.
              Variable Name: $printer
                In function: printer_mapping
         Referenced on line: 208
    208: error_check(@ERROR,@SERROR,"couldnt add $printer from $server")
          
Warning: Undeclared variable.
              Variable Name: $logfilepath
                In function: error_check
         Referenced on line: 239
          
Warning: Variable referenced inside string.
              Variable Name: $errnum
                In function: error_check
         Referenced on line: 240
          
Warning: Variable referenced inside string.
              Variable Name: $error
                In function: error_check
         Referenced on line: 240
    240: WriteLine(1, @DATE + " " + @TIME + " Error# $errnum $error occured, $message" + Chr(13) + Chr(10))
          
Warning: Undeclared variable.
              Variable Name: $logfilepath
                In function: update_logfile
         Referenced on line: 256
          
Warning: Undeclared variable.
              Variable Name: $drive:
                In function: graphical400
         Referenced on line: 266
          
Warning: Variable referenced inside string.
              Variable Name: $drive:
                In function: graphical400
         Referenced on line: 266
    266: if exist("$drive:\")
          
Warning: Undeclared variable.
              Variable Name: $System
                In function: graphical400
         Referenced on line: 271
          
Warning: Undeclared variable.
              Variable Name: $Form
                In function: graphical400
         Referenced on line: 272
          
Warning: Undeclared variable.
              Variable Name: $FrameBanner
                In function: graphical400
         Referenced on line: 278
          
Warning: Undeclared variable.
              Variable Name: $PictureBanner
                In function: graphical400
         Referenced on line: 297
          
Warning: Undeclared variable.
              Variable Name: $TextBoxUsername
                In function: graphical400
         Referenced on line: 303
          
Warning: Undeclared variable.
              Variable Name: $TextBoxPassword
                In function: graphical400
         Referenced on line: 309
          
Warning: Undeclared variable.
              Variable Name: $CmdUserLogin
                In function: graphical400
         Referenced on line: 316
          
Warning: Variable referenced inside string.
              Variable Name: $drive
                In function: graphical400
         Referenced on line: 325
          
Warning: Variable referenced inside string.
              Variable Name: $share
                In function: graphical400
         Referenced on line: 325
          
Warning: Variable referenced inside string.
              Variable Name: $server
                In function: graphical400
         Referenced on line: 325
    325: $CmdUserLogin.OnClick			= "CmdUserLogin_Click($drive,$share,$server)"
          
Warning: Undeclared variable.
              Variable Name: $CmdExit
                In function: graphical400
         Referenced on line: 326
          
Warning: Undeclared variable.
              Variable Name: $
                In function: graphical400
         Referenced on line: 343
          
Warning: Undeclared variable.
              Variable Name: $TextBoxUsername
                In function: CmdUserLogin_Click
         Referenced on line: 351
          
Warning: Undeclared variable.
              Variable Name: $
                In function: CmdUserLogin_Click
         Referenced on line: 352
          
Warning: Undeclared variable.
              Variable Name: $Form
                In function: CmdUserLogin_Click
         Referenced on line: 352
          
Warning: Undeclared variable.
              Variable Name: $StringUsername
                In function: CmdUserLogin_Click
         Referenced on line: 353
          
Warning: Undeclared variable.
              Variable Name: $TextBoxPassword
                In function: CmdUserLogin_Click
         Referenced on line: 359
          
Warning: Undeclared variable.
              Variable Name: $StringPassword
                In function: CmdUserLogin_Click
         Referenced on line: 361
          
Warning: Variable referenced inside string.
              Variable Name: $drive
                In function: CmdUserLogin_Click
         Referenced on line: 377
    377: ? "mapping $drive to $share"
          
Warning: Undeclared variable.
              Variable Name: $drive:
                In function: CmdUserLogin_Click
         Referenced on line: 378
          
Warning: Variable referenced inside string.
              Variable Name: $drive
                In function: CmdUserLogin_Click
         Referenced on line: 380
    380: error_check(@ERROR,@SERROR,"failed to remove $drive drive")
          
Warning: Variable referenced inside string.
              Variable Name: $drive
                In function: CmdUserLogin_Click
         Referenced on line: 384
    384: error_check(@ERROR,@SERROR,"failed to map $drive drive")
 57 warnings generated, 394 lines processed.

In the report.txt file (sanity warnings)
I also get the following :
 Code:
WARNINGS.CSV file:
Undeclared variable.,,$,Main,2
Undeclared variable.,,$osname,Main,4
Undeclared variable.,,$vista,Main,5
Undeclared variable.,,$logfilepath,Main,8
Undeclared variable.,,$inifile,Main,9
Undeclared variable.,,$personal_loc,Main,15
Undeclared variable.,,$desktop_loc,Main,16
Undeclared variable.,,$start_loc,Main,17
Variable referenced inside string.,,$,Main,41
     41: RUN "\\srv05wts\keyfinder\keyfinder.exe /save \\srv05wts\logs$\ /close",,,,
Undeclared variable.,,$count,ENUMINI,75
Undeclared variable.,,$personal_loc,run_functions,112
Undeclared variable.,,$desktop_loc,run_functions,112
Undeclared variable.,,$start_loc,run_functions,112
Variable referenced inside string.,,$command2,run_functions,119
    119: RUN "$command2$command",,,,
Undeclared variable.,,$,copy_files,143
Variable referenced inside string.,,$,copy_files,143
    143: $file=$server + "icons$\" + $program,,,,
Variable referenced inside string.,,$personal,copy_files,147
    147: if not exist ("$personal$program"),,,,
Variable referenced inside string.,,$file,copy_files,150
    150: error_check(@ERROR,@SERROR,"couldnt copy $file to $personal"),,,,
Variable referenced inside string.,,$desktop,copy_files,152
    152: if not exist ("$desktop$program"),,,,
Variable referenced inside string.,,$file,copy_files,155
    155: error_check(@ERROR,@SERROR,"couldnt copy $file to $desktop"),,,,
Variable referenced inside string.,,$start,copy_files,160
    160: if not exist ("$start$program"),,,,
Variable referenced inside string.,,$file,copy_files,163
    163: error_check(@ERROR,@SERROR,"couldnt copy $file to $start"),,,,
Variable referenced inside string.,,$server,drive_mapping,178
    178: $share="$server$share",,,,
Variable referenced inside string.,,$drive,drive_mapping,181
    181: ? "mapping $drive to $share",,,,
Undeclared variable.,,$drive:,drive_mapping,182
Variable referenced inside string.,,$drive,drive_mapping,184
    184: error_check(@ERROR,@SERROR,"failed to remove $drive drive"),,,,
Variable referenced inside string.,,$drive,drive_mapping,188
    188: error_check(@ERROR,@SERROR,"failed to map $drive drive"),,,,
Variable referenced inside string.,,$server,printer_mapping,205
    205: If AddPrinterConnection("$server$printer")=0,,,,
Variable referenced inside string.,,$printer,printer_mapping,208
    208: error_check(@ERROR,@SERROR,"couldnt add $printer from $server"),,,,
Undeclared variable.,,$logfilepath,error_check,239
Variable referenced inside string.,,$errnum,error_check,240
Variable referenced inside string.,,$error,error_check,240
    240: WriteLine(1, @DATE + " " + @TIME + " Error# $errnum $error occured, $message" + Chr(13) + Chr(10)),,,,
Undeclared variable.,,$logfilepath,update_logfile,256
Undeclared variable.,,$drive:,graphical400,266
Variable referenced inside string.,,$drive:,graphical400,266
    266: if exist("$drive:\"),,,,
Undeclared variable.,,$System,graphical400,271
Undeclared variable.,,$Form,graphical400,272
Undeclared variable.,,$FrameBanner,graphical400,278
Undeclared variable.,,$PictureBanner,graphical400,297
Undeclared variable.,,$TextBoxUsername,graphical400,303
Undeclared variable.,,$TextBoxPassword,graphical400,309
Undeclared variable.,,$CmdUserLogin,graphical400,316
Variable referenced inside string.,,$drive,graphical400,325
Variable referenced inside string.,,$share,graphical400,325
Variable referenced inside string.,,$server,graphical400,325
    325: $CmdUserLogin.OnClick			= "CmdUserLogin_Click($drive,$share,$server)",,,,
Undeclared variable.,,$CmdExit,graphical400,326
Undeclared variable.,,$,graphical400,343
Undeclared variable.,,$TextBoxUsername,CmdUserLogin_Click,351
Undeclared variable.,,$,CmdUserLogin_Click,352
Undeclared variable.,,$Form,CmdUserLogin_Click,352
Undeclared variable.,,$StringUsername,CmdUserLogin_Click,353
Undeclared variable.,,$TextBoxPassword,CmdUserLogin_Click,359
Undeclared variable.,,$StringPassword,CmdUserLogin_Click,361
Variable referenced inside string.,,$drive,CmdUserLogin_Click,377
    377: ? "mapping $drive to $share",,,,
Undeclared variable.,,$drive:,CmdUserLogin_Click,378
Variable referenced inside string.,,$drive,CmdUserLogin_Click,380
    380: error_check(@ERROR,@SERROR,"failed to remove $drive drive"),,,,
Variable referenced inside string.,,$drive,CmdUserLogin_Click,384
    384: error_check(@ERROR,@SERROR,"failed to map $drive drive"),,,,
 57 warnings generated, 394 lines processed.,,,,
Undeclared variable.,,$,Main,2
Undeclared variable.,,$osname,Main,4
Undeclared variable.,,$vista,Main,5
Undeclared variable.,,$logfilepath,Main,8
Undeclared variable.,,$inifile,Main,9
Undeclared variable.,,$personal_loc,Main,15
Undeclared variable.,,$desktop_loc,Main,16
Undeclared variable.,,$start_loc,Main,17
Variable referenced inside string.,,$,Main,41
     41: RUN "\\srv05wts\keyfinder\keyfinder.exe /save \\srv05wts\logs$\ /close",,,,
Undeclared variable.,,$count,ENUMINI,75
Undeclared variable.,,$personal_loc,run_functions,112
Undeclared variable.,,$desktop_loc,run_functions,112
Undeclared variable.,,$start_loc,run_functions,112
Variable referenced inside string.,,$command2,run_functions,119
    119: RUN "$command2$command",,,,
Undeclared variable.,,$,copy_files,143
Variable referenced inside string.,,$,copy_files,143
    143: $file=$server + "icons$\" + $program,,,,
Variable referenced inside string.,,$personal,copy_files,147
    147: if not exist ("$personal$program"),,,,
Variable referenced inside string.,,$file,copy_files,150
    150: error_check(@ERROR,@SERROR,"couldnt copy $file to $personal"),,,,
Variable referenced inside string.,,$desktop,copy_files,152
    152: if not exist ("$desktop$program"),,,,
Variable referenced inside string.,,$file,copy_files,155
    155: error_check(@ERROR,@SERROR,"couldnt copy $file to $desktop"),,,,
Variable referenced inside string.,,$start,copy_files,160
    160: if not exist ("$start$program"),,,,
Variable referenced inside string.,,$file,copy_files,163
    163: error_check(@ERROR,@SERROR,"couldnt copy $file to $start"),,,,
Variable referenced inside string.,,$server,drive_mapping,178
    178: $share="$server$share",,,,
Variable referenced inside string.,,$drive,drive_mapping,181
    181: ? "mapping $drive to $share",,,,
Undeclared variable.,,$drive:,drive_mapping,182
Variable referenced inside string.,,$drive,drive_mapping,184
    184: error_check(@ERROR,@SERROR,"failed to remove $drive drive"),,,,
Variable referenced inside string.,,$drive,drive_mapping,188
    188: error_check(@ERROR,@SERROR,"failed to map $drive drive"),,,,
Variable referenced inside string.,,$server,printer_mapping,205
    205: If AddPrinterConnection("$server$printer")=0,,,,
Variable referenced inside string.,,$printer,printer_mapping,208
    208: error_check(@ERROR,@SERROR,"couldnt add $printer from $server"),,,,
Undeclared variable.,,$logfilepath,error_check,239
Variable referenced inside string.,,$errnum,error_check,240
Variable referenced inside string.,,$error,error_check,240
    240: WriteLine(1, @DATE + " " + @TIME + " Error# $errnum $error occured, $message" + Chr(13) + Chr(10)),,,,
Undeclared variable.,,$logfilepath,update_logfile,256
Undeclared variable.,,$drive:,graphical400,266
Variable referenced inside string.,,$drive:,graphical400,266
    266: if exist("$drive:\"),,,,
Undeclared variable.,,$System,graphical400,271
Undeclared variable.,,$Form,graphical400,272
Undeclared variable.,,$FrameBanner,graphical400,278
Undeclared variable.,,$PictureBanner,graphical400,297
Undeclared variable.,,$TextBoxUsername,graphical400,303
Undeclared variable.,,$TextBoxPassword,graphical400,309
Undeclared variable.,,$CmdUserLogin,graphical400,316
Variable referenced inside string.,,$drive,graphical400,325
Variable referenced inside string.,,$share,graphical400,325
Variable referenced inside string.,,$server,graphical400,325
    325: $CmdUserLogin.OnClick			= "CmdUserLogin_Click($drive,$share,$server)",,,,
Undeclared variable.,,$CmdExit,graphical400,326
Undeclared variable.,,$,graphical400,343
Undeclared variable.,,$TextBoxUsername,CmdUserLogin_Click,351
Undeclared variable.,,$,CmdUserLogin_Click,352
Undeclared variable.,,$Form,CmdUserLogin_Click,352
Undeclared variable.,,$StringUsername,CmdUserLogin_Click,353
Undeclared variable.,,$TextBoxPassword,CmdUserLogin_Click,359
Undeclared variable.,,$StringPassword,CmdUserLogin_Click,361
Variable referenced inside string.,,$drive,CmdUserLogin_Click,377
    377: ? "mapping $drive to $share",,,,
Undeclared variable.,,$drive:,CmdUserLogin_Click,378
Variable referenced inside string.,,$drive,CmdUserLogin_Click,380
    380: error_check(@ERROR,@SERROR,"failed to remove $drive drive"),,,,
Variable referenced inside string.,,$drive,CmdUserLogin_Click,384
    384: error_check(@ERROR,@SERROR,"failed to map $drive drive"),,,,
 57 warnings generated, 394 lines processed.,,,,

=========================

VarInfo.INI file:
[ENUMINI]
DefinedOnLine=60
$ENUMINI=1,60
$fl=2,60
$sections=2,61
$keys=2,61
$sectionkey=2,61
$sectionentry=2,61
$rc=2,61
$resource=2,61
$commands=2,61
$desc=2,61
$function=2,61
$count=2,75
[run_functions]
DefinedOnLine=97
$run_functions=1,97
$function=2,97
$desc=2,97
$command=2,97
$command2=2,97
$command3=2,97
$personal_loc=0,112
$desktop_loc=0,112
$start_loc=0,112
[copy_files]
DefinedOnLine=140
$copy_files=1,140
$personal=2,140
$desktop=2,140
$start=2,140
$server=2,140
$program=2,140
$file=2,141
$=0,143
[drive_mapping]
DefinedOnLine=177
$drive_mapping=1,177
$drive=2,177
$share=2,177
$server=2,177
$drive:=2,182
[printer_mapping]
DefinedOnLine=204
$printer_mapping=1,204
$server=2,204
$printer=2,204
[registry_fixes]
DefinedOnLine=217
$registry_fixes=1,217
$path=2,217
$field=2,217
$value=2,217
$type=2,217
[error_check]
DefinedOnLine=237
$error_check=1,237
$errnum=2,237
$error=2,237
$message=2,237
$logfilepath=0,239
[update_logfile]
DefinedOnLine=255
$update_logfile=1,255
$logfilepath=0,256
[graphical400]
DefinedOnLine=265
$graphical400=1,265
$drive=2,265
$share=2,265
$server=2,265
$StringUsername=2,336
$StringPassword=2,337
$drive:=0,266
$System=2,271
$Form=2,272
$FrameBanner=2,278
$PictureBanner=2,297
$TextBoxUsername=2,303
$TextBoxPassword=2,309
$CmdUserLogin=2,316
$CmdExit=2,326
$=0,343
[CmdUserLogin_Click]
DefinedOnLine=350
$CmdUserLogin_Click=1,350
$drive=2,350
$share=2,350
$server=2,350
$TextBoxUsername=2,351
$=2,352
$Form=2,352
$StringUsername=2,353
$TextBoxPassword=2,359
$StringPassword=2,361
$drive:=2,378
[Main]
$=2,2
$osname=2,4
$vista=2,5
$logfilepath=0,8
$inifile=2,9
$personal_loc=2,15
$desktop_loc=2,16
$start_loc=2,17

These extra files are in a format easily read by a program, and give you critical information about the functions and the variables used in those functions, in addition to the warnings.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D