
How to read a registry key in a script
Quote:
> One other question then, how can I take this value that the script gets and
> then if it is one thing use this patch and if it is another use patch b?
Set oShell = CreateObject("Wscript.Shell")
sIEver = oShell.RegRead("HKLM\Software\Microsoft\Internet Explorer\Version")
If sIEver = "5.50.4807.2300" Then
WScript.Echo "IE is v5.5 SP2"
ElseIf sIEver = "6.0.2800.1106" Then
WScript.Echo "IE is v6.0 SP1"
Else
WScript.Echo "I don't know this IE version"
End If
' alternatively
Select Case sIEver
Case "5.50.4807.2300"
WScript.Echo "IE is v5.5 SP2"
Case "6.0.2800.1106"
WScript.Echo "IE is v6.0 SP1"
Case Else
WScript.Echo "I don't know this IE version"
End Select
Quote:
> Do you know a good resource for this stuff? I dont want to bug a nice person
> tooo much! :)
WSH 5.6 documentation download:
http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/00...
and as my sig states:
Administration scripting examples and a ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter
Starting e.g. here
Scripting Concepts and Technologies for System Administration
http://www.microsoft.com/technet/scriptcenter/scrguide/sas_pt1_overvi...
Here are some Windows Script Host (WSH) Web introductions:
WSH
http://cis.stvincent.edu/wsh/index.html
Introduction to Windows Scripting
http://www.winguides.com/article.php?id=2
NT Gains Scripting Muscle
An introduction to Windows Script Host by Bob Wells.
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=3026
Scripting 101
A 4 part series on how to create and structure WSH scripts by Bob Wells
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=5410
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=5505
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=5683
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=7112
VBScript Primer
http://www.microsoft.com/technet/prodtechnol/windows2000serv/maintain...
Here is a newsgroup thread you should look at as well with links to other
resources:
Subject: beginner looking for resources
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-01-31 08:11:00 PST
http://groups.google.com/groups?hl=en&th=7015b808b5fb0cb4
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and a ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter