for a project, im making a system that will tell users what software their computer can use when compared with a list of known software specifications, but id like to know if VB6 can be coded to shows the user what their processor is, its clock speed, the amount of RAM, and avaliable hard drive space etc. currently i am working around the problem by using a command button to launch Dxdiag and letting the user input specs manually
How to make visual basic return system information?
Collapse
X
-
David WroeTags: None -
Software Engineer
'With this script and the WScript host, you can query
'information about a user's PC. Wrap this code in
'a function and work from user input by iterating the
'wscript.argume nts collection. For more info about a
'computer, query the win32_ComputerS ystem.
''force explicit variable declaration
option explicit
''declare variables
dim compStr, wmiObj, settingsColl, procObj
''set the computer to query
compStr= "."
''instantiate the WMI object
set wmiObj = GetObject("winm gmts:{impersona tionLevel=imper sonate}!\\" & compStr & "\root\cimv 2")
''query the computer's processor info
set settingsColl= wmiObj.ExecQuer y ("SELECT * FROM Win32_Processor ")
''iterate the processors to display info
for each procObj in settingsColl
Wscript.Echo "System Type: " & procObj.Archite cture
Wscript.Echo "Processor: " & procObj.Descrip tion
next -
David Wroe
thanks for the help, but its saying something about, Wscript nto being declaired? im not sure what to declair it as in this caseComment
Comment