|
-
Oct 23rd, 2002, 03:18 AM
#1
Thread Starter
PowerPoster
Computer Inofmration
Hey all ,
Does anyone know of a way to retrieve the fllowing:
HDD size
RAM Total Size
OS and Serice Pack
CPU Speed
On every windows OS!
Any help would be appreciated.
thanks
b
-
Oct 23rd, 2002, 03:31 AM
#2
Try looking up "WMI" at http://www.mvps.org for samples on these.
-
Oct 23rd, 2002, 03:31 AM
#3
Member
I'm not sure how, but I remember in VB6 that if you added frmAbout Form, it contained a section 'System Info'.
Take a look at the code behind it.
Hope this helps
MartinLG
Tell me, and I will forget. Show me, and I will remember. Involve me, and I will care.
-
Oct 23rd, 2002, 03:34 AM
#4
Martin, this calls on the windows system information program - it's a bit like the shell command calling on another program to get this information so thiswon't really help this time. 
Course if he does use that one it'd save him a load of coding
-
Oct 23rd, 2002, 03:41 AM
#5
Member
Correct, Alex!
Tell me, and I will forget. Show me, and I will remember. Involve me, and I will care.
-
Oct 23rd, 2002, 03:43 AM
#6
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Oct 23rd, 2002, 07:44 PM
#7
Thread Starter
PowerPoster
Re: Re: Computer Inofmration
-
Oct 23rd, 2002, 08:32 PM
#8
PowerPoster
Well
The Microsoft SysInfo control provides a great way of gathering system information
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Oct 23rd, 2002, 08:52 PM
#9
Thread Starter
PowerPoster
James but it doesnt supply this information.
As far as i can gather!
-
Oct 23rd, 2002, 09:08 PM
#10
PowerPoster
Well
Found this in a search :
A DLL file (moo.dll) with example. Will return your Operating System, Processor, Memory Information, Hard
Drive Information (sample only shows drive C:\) Display Settings and
Network Interface Information.
<Attachment (DLL File) removed by admin due to potential 'badness' >
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Oct 25th, 2002, 03:20 AM
#11
Retired VBF Adm1nistrator
Beacon, I can send you on some source from IS-IT-Legit that will get that info if you want.
All done through VB
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Oct 25th, 2002, 03:27 AM
#12
Frenzied Member
-
Oct 25th, 2002, 08:33 AM
#13
PowerPoster
Well
Ultimasnake : People are here to offer suggestions to your problems. Some may provide source code, other dll or ocx, while others may recommend applications. It's all help...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Oct 25th, 2002, 08:55 AM
#14
Frenzied Member
Thats true , but shouldnt vb related stuff be vb source related? any program can be written in any language.. but i understand it, just think it is rather anoying sometimes.. when i ask for a way to get the computers name people say things like : download computer info , it's just 800 mb and costs only $1.000.000 .. ... neway... i understand :P
-
Oct 30th, 2002, 07:55 PM
#15
Thread Starter
PowerPoster
Hye Guy's
To clarify i've been contacting with Jamie for months now so his offer was legit (pun intended) it was a kind of jest! 
Jamie:
ONE BIG THING!
IS-IT-Legit NEEDS TO plug into or run with A.D do this using ADSI!
b
-
Oct 31st, 2002, 05:39 AM
#16
I've just been getting into this myself http://216.26.168.92/vbsquare/demos/...Admin.cls.html
or "Windows NT/2000 ADSI Scripting for System Administration" by Macmillan Technical Publishing ISBN: 1-57870-219-4 is a fantastic resource for ADSI scripting with vb!
-
Oct 31st, 2002, 07:19 AM
#17
Fanatic Member
Hi Beacon
I use this informations in a application. I downloaded from API.COM the code for it.
nice greetings
Franky
(Still on the way to Bali? Maybe Thailand is better now ....)
-
Oct 31st, 2002, 09:02 AM
#18
Fanatic Member
I think you can use SysInfo to get OS and service pack, Um, the code below is to get RAM, available RAM, and Vram and such:'
(for this example you need to have label1)
VB Code:
Option Explicit
Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
Private Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Private memInfo As MEMORYSTATUS
Private Sub Form_Load()
Call GlobalMemoryStatus(memInfo)
memInfo.dwLength = Len(memInfo)
Label1 = Int((memInfo.dwTotalPhys / 1024) / 1024) & " MB of RAM"
End Sub
-
Oct 31st, 2002, 09:30 AM
#19
Frenzied Member
I have used this (got most of it from thsi board - thanks guys)
Creat a form, call it frmmain, ad a text box - call it text1, and creat a command button - call it command 1.
Past this into the form and you shoulf be good to go..
Hopefully it will provide all the info you need..
Rudy
Option Explicit
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private ComputerName As String
Private Sub Command1_Click()
Dim WMI
Dim wmiWin32Objects
Dim wmiWin32Object
frmMain.MousePointer = vbHourglass
frmMain.Command1.MousePointer = vbNoDrop
frmMain.Text1.Text = "Connecting....."
DoEvents
On Error GoTo CanNotConnect
Set WMI = GetObject("WinMgmts://" & ComputerName)
Set wmiWin32Objects = WMI.InstancesOf("Win32_Processor")
With wmiWin32Object
For Each wmiWin32Object In wmiWin32Objects
DoEvents
frmMain.Text1.Text = "AddressWidth: " & .AddressWidth
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Architecture: " & .Architecture
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Availability: " & .Availability
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Caption: " & .Caption
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ConfigManagerErrorCode: " & .ConfigManagerErrorCode
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ConfigManagerUserConfig: " & .ConfigManagerUserConfig
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CpuStatus: " & .CpuStatus
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CreationClassName: " & .CreationClassName
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CurrentClockSpeed: " & .CurrentClockSpeed
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CurrentVoltage: " & .CurrentVoltage
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "DataWidth: " & .DataWidth
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Description: " & .Description
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "DeviceID: " & .DeviceID
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ErrorCleared: " & .ErrorCleared
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ErrorDescription: " & .ErrorDescription
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ExtClock: " & .ExtClock
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Family: " & .Family
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "InstallDate: " & .InstallDate
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "L2CacheSize: " & .L2CacheSize
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "L2CacheSpeed: " & .L2CacheSpeed
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "LastErrorCode: " & .LastErrorCode
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Level: " & .Level
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "LoadPercentage: " & .LoadPercentage
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Manufacturer: " & .Manufacturer
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "MaxClockSpeed: " & .MaxClockSpeed
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Name: " & .Name
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "OtherFamilyDescription: " & .OtherFamilyDescription
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "PNPDeviceID: " & .PNPDeviceID
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "PowerManagementCapabilities: " & .PowerManagementCapabilities
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "PowerManagementSupported: " & .PowerManagementSupported
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ProcessorId: " & .ProcessorId
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ProcessorType: " & .ProcessorType
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Revision: " & .Revision
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Role: " & .Role
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "SocketDesignation: " & .SocketDesignation
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Status: " & .Status
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "StatusInfo: " & .StatusInfo
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Stepping: " & .Stepping
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "SystemCreationClassName: " & .SystemCreationClassName
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "SystemName: " & .SystemName
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "UniqueId: " & .UniqueId
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "UpgradeMethod: " & .UpgradeMethod
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Version: " & .Version
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "VoltageCaps: " & .VoltageCaps
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Description: " & .Description
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Manufacturer: " & .Manufacturer
frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "MaxClockSpeed: " & .MaxClockSpeed
DoEvents
Next
End With
frmMain.MousePointer = vbDefault
frmMain.Command1.MousePointer = vbDefault
DoEvents
Exit Sub
CanNotConnect:
If Err.Number = 462 Then
Call MsgBox("Unable to connect to " & ComputerName & vbNewLine & "Make sure you spelled the PC Name correctly with proper casing!", vbOKOnly + vbCritical, "No Connection")
Err.Number = 0
frmMain.MousePointer = vbDefault
frmMain.Command1.MousePointer = vbDefault
DoEvents
Else
Call MsgBox("Unable to connect to that PC" & vbNewLine & "Error # " & Err.Number & " - " & Err.Description, vbOKOnly + vbCritical, "No Connection")
Err.Number = 0
frmMain.MousePointer = vbDefault
frmMain.Command1.MousePointer = vbDefault
DoEvents
End If
End Sub
Private Sub Form_Load()
Dim NameSize As Long
Dim X As Long
Dim MachineName As String
MachineName = Space$(16)
NameSize = Len(MachineName)
X = GetComputerName(MachineName, NameSize)
ComputerName = Trim(MachineName)
frmMain.Caption = frmMain.Caption & " - " & ComputerName
DoEvents
End Sub
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|