472,133 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

How to make visual basic return system information?

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
Nov 2 '10 #1
2 1703
'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.arguments collection. For more info about a
'computer, query the win32_ComputerSystem.


''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("winmgmts:{impersonationLevel=impersonat e}!\\" & compStr & "\root\cimv2")

''query the computer's processor info
set settingsColl= wmiObj.ExecQuery ("SELECT * FROM Win32_Processor")

''iterate the processors to display info
for each procObj in settingsColl
Wscript.Echo "System Type: " & procObj.Architecture
Wscript.Echo "Processor: " & procObj.Description
next
Nov 4 '10 #2
thanks for the help, but its saying something about, Wscript nto being declaired? im not sure what to declair it as in this case
Nov 9 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

97 posts views Thread by Master Programmer | last post: by
1 post views Thread by =?Utf-8?B?QWpheSBTaGFyZGE=?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.