I would like to add it to this script. It is to fix a problem on 120+/- machines.
Code:
GOSUB Setup
IF $ErrMessage = ""
$Machine = READLINE(1)
WHILE @ERROR = 0
? ? "Now Processing Machine: " + $Machine
; Change the following line according to what you need to do.
WRITEVALUE("\\$Machine\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance","Disable Performance Counters","00000000","REG_DWORD")
IF @ERROR = 0
$TestResults = "SMS Reg Fix change completed OK"
ELSE
$TestResults = "SMS Reg Fix change failed (@ERROR)"
ENDIF
; ? "Completed Current Workstation processing."
; $OutError = WRITELINE(2, $Machine + ", " + $TestResults + CHR(13) + CHR(10) )
; $Machine = READLINE(1)
LOOP
?
? "Target File List Completed."
?
CLOSE(1)
CLOSE(2)
ENDIF
; Main Section End
EXIT
:Setup
;
; This Subroutine Initializes the File I/O operations and sets up variables
;
SETCONSOLE("FOREGROUND")
BREAK ON
CLS
FLUSHKB
IF OPEN(1, "C:\LScript\Targets.txt", 2) <> 0
$ErrMessage = "Unable to open Targets.TXT file in current directory."
? $ErrMessage
ENDIF
IF OPEN(2, "Results.txt", 5) <> 0
$ErrMessage = "Unable to open/create Results.TXT file in current directory."
? $ErrMessage
ENDIF
RETURN