hans said:
I found a lot of info on different wmi keys but haven't figured out how I can
acutally get the information out into a text file.
If there is some document that explains the syntax and what type of script
file or program I can use to get that info out.
Thanks for the help.
Hi,
With VBScript:
'--------------------8<----------------------
Const OverwriteIfExist = -1
Const OpenAsASCII = 0
' File that result will be written to
strOutFile = "C:\SerialNr.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
strComputer = "." ' use "." for local computer
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colBIOS = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
For Each objBIOS in colBIOS
strSerialNr = objBIOS.SerialNumber
Next
' Create file
Set fOutFile = objFSO.CreateTextFile(strOutFile, _
OverwriteIfExist, OpenAsASCII)
fOutFile.WriteLine strSerialNr
fOutFile.Close
'--------------------8<----------------------
Here are some WSH starting points:
WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
Welcome to the Script Center
http://www.microsoft.com/technet/scriptcenter/default.mspx
The updated Portable Script Center (v3.0), the *.chm version of all of
the sample scripts on the TechNet Script Center site...
Download details: System Administration Scripting Guide Scripts
http://www.microsoft.com/downloads/...familyid=b4cb2678-dafb-4e30-b2da-b8814fe2da5a
For a list of some scripting resources and links to some Windows Script
Host (WSH) Web introductions, take a look here:
http://groups.google.co.uk/[email protected]