Page 1 of 1 1
Topic Options
#408 - 1999-09-07 09:28 AM software install / registry lookups
Anonymous
Unregistered


I want to be able to distribute our virus software if the kixtart logon script does not detect a certain registry entry.

Assuming we're working only on WINNT, I've scripted the following:

:check registry entries to install inoculan if not intalled

EXISTKEY("HKEY_LOCAL_MACHINE\SOFTWARE\Cheyenne\InocuLAN")
If @ERROR = 1
shell "C:\COMMAND.COM /C"+@LDRIVE+" \inoc.bat"
end if

I pulled the "EXISTKEY.." function from a sample script web site, but it doesn't seem to be working correctly. How do I get Kixtart to look for a registry key, and if it doesn't find it, call a batch file. If it does find it, I just want it to bypass the routine...

Thanks

Nathan Ely, MCSE
TEKSystems, Inc

Top
#409 - 1999-09-08 07:42 AM Re: software install / registry lookups
Anonymous
Unregistered


Hi Nathan,

First, I'm not positive, but I don't think existkey sets the @error macro. It is a function. You should set a variable to it and test the variable.

$returncode=ExistKey("HKEY_LOCAL_MACHINE/...")
If $returncode=0
? "Hey, my key is alive!"
Else
? "No stinking key!"
Endif

Another thing to be careful of is that existkey, at least in my experience, only checks for the existence of keys. It will not check for the existence of a value. Make sure what you are looking for is a key. If it is a value, you can try to read the value, or use enumvalue.

Also, on NT, you probably don't want to shell to c:\command.com. Just to make sure someone hasn't installed a workstation with a non-standard winnt directory, I use:
$comd="@LANROOT\cmd.exe /c "

Hope that helps.

Regards,

Brad Van Orden

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 1343 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.024 seconds in which 0.012 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