Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

login script to check/force update of virus scan software

Status
Not open for further replies.

campm

Technical User
Oct 28, 2003
2
US
I have been piddling with VBscript for less than a year and mostly quick scripts to set values in .ini files and the sort that we push out via Active directory.
My department head now wants me [surprise] to write a logon script to do the following:
- for all W2k and XP machines
- check the virus scan dat file
- if it is not updated, start the update process
- if that fails, send a message to the user/helpdesk
then shutdown the computer.

(and wants it NOW)
This is beyond my limited knowledge.
Any Ideas, suggestions? Any suggestions in direction or snippets of code would be greatly appreciated. :)

MWC
 
I may not have the answer to your entire code needs, but here's the first part, how to determine whether the computer is in the NT family (NT/2000/XP) or not (98/98se/Me):
Code:
Dim objWsh, x, flagNT
flagNT="HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\Environment\OS"
x=objWsh.regread(flagNT)
If Err.Number = 0 Then
   flagNT = true  ' Either Windows 2000 or XP - Environment\OS key not in 98/98se/Me
Else
   flagNT = false
   Err.Clear
End If
 
Small typo on the key listed above. SessionManager should be Session Manager with a space separating the two words. SessionManager is instead used by Windows 9x family. Corrected code:
Code:
Dim objWsh, x, flagNT
flagNT="HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\OS"
Set objWsh = CreateObject("WScript.Shell")
x=objWsh.regread(flagNT)
If Err.Number = 0 Then
   flagNT = true  ' Either Windows 2000 or XP - Environment\OS key not in 98/98se/Me
Else
   flagNT = false
   Err.Clear
End If
-----------------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top