Link to home
Start Free TrialLog in
Avatar of ausjay
ausjay

asked on

Using VBScript to return the Dell Service Tag

Trying to get VBScript to return the Dell Service Tag or "Serial Number" from the BIOS.  Can get it to work ok in Win2K/XP but have a problem in Windows 98.  

Does the WMI Win32_SystemEnclosure class even work in Windows 98?

Here is the script that works for Win2k/XP.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
Wscript.Echo "Serial Number: " & objSMBIOS.SerialNumber
Wscript.Echo "Asset Tag: " & objSMBIOS.SMBIOSAssetTag
Next
ASKER CERTIFIED SOLUTION
Avatar of vinnyd79
vinnyd79

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ausjay
ausjay

ASKER

Thanks, that does get the script to work.  I was just hoping that wouldn't have to install it before getting the script to work.