Any help that you can provide me would be greatly appreciated.
Thanks,
Mike Deering
Value
Description
1
Other
2
Unknown
3
Desktop
4
Low Profile Desktop
5
Pizza Box
6
Mini Tower
7
Tower
8
Portable
9
Laptop
10
Notebook
11
Hand Held
12
Docking Station
13
All in One
14
Sub Notebook
15
Space-Saving
16
Lunch Box
17
Main System Chassis
18
Expansion Chassis
19
Sub Chassis
20
Bus Expansion Chassis
21
Peripheral Chassis
22
Storage Chassis
23
Rack Mount Chassis
24
Sealed-Case PC
Again, thanks for any help you might provide.
Mike Deering
"Mike Deering" <mbd...@adelphia.net> wrote in message
news:WsdZ9.10808$ni5.1...@news1.news.adelphia.net...
If g_sSysType = "2" Then WScript.Echo "This must be an Epiq"
If g_sSysType = "23" Then WScript.Echo "This is a Rack Mounted Server"
Next
Next
"Mike Deering" <mbd...@adelphia.net> wrote in message
news:WsdZ9.10808$ni5.1...@news1.news.adelphia.net...
>
What registry key does the asset management software write to?
chassis = wmiChassisType("MKD06")
function wmiChassisType(computer)
Dim WmiService, colChassis, Chassis, intType
Set WmiService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& computer & "\root\cimv2")
Set colChassis = WmiService.ExecQuery _
("SELECT ChassisTypes FROM Win32_SystemEnclosure")
For Each Chassis in colChassis
For Each intType in Chassis.ChassisTypes
wmiChassisType = Cstr(intType)
Next
Next
end function
--
Please respond in the newsgroup so everyone may benefit.
http://dev.remotenetworktechnology.com
----------
Subscribe to Microsoft's Security Bulletins:
http://www.microsoft.com/technet/security/bulletin/notify.asp
"Mike Deering" <mbd...@adelphia.net> wrote in message
news:SOdZ9.10937$ni5.1...@news1.news.adelphia.net...
> I must also (use a .flg file??) determine whether is is already installed.
> It does leave a registry key.
Using VBScripts RegRead method, unless all your client computers are guaranteed
running English versions of the OS, it is much better to test for the existence
of a value instead of a key, see the RegValueExists function below
Documentation for the function:
RegValueExists(sRegValue)
Input param:
sRegValue ' NB! Value, not Value Data. Abbreviasjon
like eg. HKLM is allowed.
Return value:
Is True if registry value exists, else False.
Note: If sRegValue has a trailing \, True will be returned if
Defalt value (="@" in a registry file) is set (but its
value data can still be empty!), else False will be
returned (seen as "(value not set)" with Regedit.exe)
Example on use:
bRetVal = RegValueExists("HKCU\Software\Bogus\Some value")
Code:
Function RegValueExists(sRegValue)
Dim RegReadReturn
RegValueExists = True
On Error Resume Next
RegReadReturn = oShell.RegRead(sRegValue)
If Err Then
RegValueExists = False
Err.clear
End if
On Error Goto 0
End Function
If you absolutely must test on a key, you should use WMI's StdRegProv instead of
WSH's RegRead.
In the link below, you will find two functions using WMI, one to check for
registry key and another one checking if a value exists. See further down in the
post for a functions that only uses WSH RegRead to check if a key exists. Note
that to use WSHs RegRead method to do this correctly, you need to test on the
error message text and not the error number, and this error message may differ
in non-English versions of WSH ! The WMI method does not suffer under this
limitation.
From: Torgeir Bakken (Torgeir.B...@hydro.com)
Subject: Re: Check if registry key exists
Newsgroups: microsoft.public.scripting.vbscript, microsoft.public.scripting.wsh
Date: 2002-09-19 14:32:04 PST
http://groups.google.com/groups?selm=3D8A41AD.44D95564%40hydro.com
--
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