469,076 Members | 1,402 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,076 developers. It's quick & easy.

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 1652
'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
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.