Page 1 of 1 1
Topic Options
#162819 - 2006-06-03 12:23 AM Read computer name from text file and unreg a dll if necessary
ClintW Offline
Lurker

Registered: 2006-06-03
Posts: 3
I need to run the following script against each one of my servers. These are mostly Windows 2003 SP1 and a couple of Windows 2000 SP4 servers. I am trying to disable McAfee scriptscan by reading a registry key and if it isn't the correct value calling a batch file to run regsvr32 /u scriptproxy.dll.

; Check for servers with scriptscan enabled

;How do I read from a text file with some server names inside and process the below code 1 at a time?

$scriptscancheck = ""
$scriptscancheck = READVALUE ("HKEY_CLASSES_ROOT\CLSID\{B54F3741-5B07-11cf-A4B0-00AA004A55E8}\InprocServer32", "Default")


IF $scriptscancheck = "C:\Program Files\Network Associates\VirusScan\scriptproxy.dll"
$correct_scriptscanvalue="no"
; Scriptscan Check
REDIRECTOUTPUT ("\\servername\global$\mcafee\scriptscanverson_wrong.txt",0)
? "Scriptscan chkd " + $scriptscancheck + " "
REDIRECTOUTPUT ("")
Goto Unreg_scriptscan
ELSE
$correct_script="yes"
Goto (how do i get back to the text file from here?)
ENDIF


;************************************************************
:Goto Unreg_scriptscan

;How do I get the server to unregister a dll if I am running this script from my desktop and then loop to the next server in the text file


;************************************************************
:END

EXIT

Top
#162820 - 2006-06-03 01:26 AM Re: Read computer name from text file and unreg a dll if necessary
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Hello Clint and Welcome to the board.

What version of KiXtart are you using?
What is you desktop OS?
Do you have Domain Admin or at least Admin rights on all these Servers?

Do you already know how to use UDFs. If not please read the FAQ on using UDF scripts and provide the above information so that we can better assist you.
 

Top
#162821 - 2006-06-03 01:34 AM Re: Read computer name from text file and unreg a dll if necessary
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Don't use GOTO.

Look for the ReadFile() UDF. Then just iterate through the returned array.

For each $server in $Servers
;do stuff
Next

and don't use GOTO!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#162822 - 2006-06-06 06:53 AM Re: Read computer name from text file and unreg a dll if necessary
ClintW Offline
Lurker

Registered: 2006-06-03
Posts: 3
NTDOC,

Thanks for the help.

I am running Kix 4.51
I am a full domain administrator.
I am running Windows XP SP2/McAfee Virus Enterprise v8.00 Patch11

I have read up on the UDF files and I will look into the Readfile() udf. Forgive me, but I am very green with Kix and scripting in general and definitely belong the starters group. Thanks again for the help. I will followup tomorrow once I get a chance to put together my script with this udf help.

Thx

Top
#162823 - 2006-06-06 06:54 AM Re: Read computer name from text file and unreg a dll if necessary
ClintW Offline
Lurker

Registered: 2006-06-03
Posts: 3
Les, thanks for the suggestion. I will attempt this tomorrow and see if I can get it going. I will follow up either way...thx!
Top
Page 1 of 1 1


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

Who's Online
0 registered and 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.061 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