> Hi,
>
> how can I read out standard parameters of the hard- and software
> configuration of the PC?
What do you consider standard? For that matter, I'm not even sure what you
mean by parameters. Be specific about the exact information you're wanting
to obtain.
Do you want to know the version of Windows? You can use the GetVersionEx
function for that. Do you want to know what drives are installed? You can
use GetLogicalDriveStrings to get a list of drive letters, GetDriveType to
determine what kind of drive it is, GetDiskFreeSpaceEx (or GetDiskFreeSpace
for Win9x) to determine total drive size and available free space,
GetVolumeInformation to determine the file system (FAT, FAT32, NTFS, etc.).
You can use GlobalMemoryStatusEx (or GlobalMemoryStatus for Win9x) to get
information about memory. Let's see, there's also GetSystemInfo to get
information about the processor, and GetDeviceCaps can give you various
pieces of info about the printer and display (pretty much anything that has
a Device Context).
That should get you started. If you search www.google.com, you should be
able to find web sites or newsgroup posts providing sample code for
everything I mentioned.
Anything specific that you need to know about a system, you've got to tell
us.

Signature
Mike
Microsoft MVP Visual Basic
JMossler - 06 Jul 2007 23:40 GMT
Hi Mike,
yes absolutly right :-)
I will have to define the concrete information I want to read out from a
system.
Will post again, if I couldn't find it in the net.
Regards
JMossler
>> Hi,
>> how can I read out standard parameters of the hard- and software
[quoted text clipped - 22 lines]
> Anything specific that you need to know about a system, you've got to tell
> us.
JMossler - 11 Jul 2007 12:47 GMT
Hi Mike,
now I have a concrete question :-)
I used the WMI to find out everything about the network configuration.
But I don't know how to get the current adapter name.
The sample code I found was:
Set oAdapters = GetObject("winmgmts:").execquery( _
"SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled =
True")
For Each oAdapter In oAdapters
List1.AddItem ""
With oAdapter
' MAC-Adresse
List1.AddItem "MAC:" & vbTab & vbTab & .MACAddress
' IP-Adresse
List1.AddItem "IP:" & vbTab & vbTab & Join(.IPAddress)
' SubNet-Masks
List1.AddItem "MASK:" & vbTab & vbTab & Join(.IPSubnet)
' Default-Gateways
If Not IsNull(.DefaultIPGateway) Then
List1.AddItem "GATE:" & vbTab & vbTab & Join(.DefaultIPGateway)
End If
' DNS - Primary/Secondary
List1.AddItem "DNS:" & vbTab & vbTab & .DNSHostName
' WINS - Primary
If .WINSPrimaryServer <> "" Then
List1.AddItem "WINS Primary:" & vbTab & .WINSPrimaryServer
End If
' WINS - Secondary
If .WINSSecondaryServer <> "" Then
List1.AddItem "WINS:" & vbTab & .WINSSecondaryServer
End If
End With
Do you knwo a good documentation of the WMI, which parameters are available
and so on.Because dragging the object to the variable watch window doesn't
help.Thanks in advance!RegardsJMossler
>> Hi,
>>
[quoted text clipped - 23 lines]
> Anything specific that you need to know about a system, you've got to tell
> us.
mayayana - 11 Jul 2007 13:52 GMT
> Do you knwo a good documentation of the WMI, which parameters are available
> and so on.Because dragging the object to the variable watch window doesn't
> help.
It's an odd setup. Even though it's typically accessed
through COM, WMI is not COM. If you see this post it
might provide some help:
------------------
group: microsoft.public.scripting.wsh
date: 7-9-07
subject: "determine set of attributes"
quote from post:
"I document default W2k AD attributes in this link:
http://www.rlmueller.net/UserAttributes.htm "
------------------
I thought there was also some kind of WMI-specific
object browser, too, but I may be wrong. In any case,
it's typically used in scripting. You're likely to get better
answers in microsoft.public.scripting.wsh or
microsoft.public.scripting.vbscript.
As for documenting software: WMI is a comprehensive
system that, I think, was originally designed for network
admininstrators, to fill in the gaps of scripting. But it's
comprehensive in the sense of being a standardized
(if eccentric) system and syntax. I think that much of it
does little more than wrap other functionality in its
standardization. The case of enumerating installed software
is an example. WMI just partially wraps Windows
Installer. You can only return information about software
installed via .msi files. You still have to go through the
Registry to get all software, and you can actually return more
information about .msi installs (if necessary) using the
WindowsInstaller.Installer object directly.
There was at least one big WMI article in MSDN when
it first came out. (2000? 2001?) I think there was also
an article in VBPJ. At first they were trying to sell it as
a better way to get things done in VB. (And actually, a lot
of system utility software for returning hardware config.
data seems to be little more than a wrapper around WMI.)
JMossler - 11 Jul 2007 20:49 GMT
Don'T understand spontaniously how I can use those AD attributes,
but I'll find that out.
Thanks a lot !
>> Do you knwo a good documentation of the WMI, which parameters are
> available
[quoted text clipped - 43 lines]
> of system utility software for returning hardware config.
> data seems to be little more than a wrapper around WMI.)
mayayana - 12 Jul 2007 00:50 GMT
> Don'T understand spontaniously how I can use those AD attributes,
I'm afraid I may have sent you on a wild goose chase with
that. Richard Mueller is a dependable poster in the VBS
group, and someone had asked about listing WMI properties,
so I just assumed the link he posted was to good WMI
resources at his site. It appears that actually wasn't the case.
I've never really dealt with WMI much myself, so I
don't know about the best sources. There's this:
http://msdn2.microsoft.com/en-us/library/aa394572.aspx
But it's MSDN, which is usually not a very usable resource
when you need a lot of info. If you don't find what you need,
I'd ask in the vbscript group. There are a lot of network
admins there who use WMI.
JMossler - 12 Jul 2007 09:50 GMT
OK,
I will try to find as many information as possible by myself and if sth. is
still missing I will ask you again.
Thanks again.
>> Don'T understand spontaniously how I can use those AD attributes,
>
[quoted text clipped - 13 lines]
> I'd ask in the vbscript group. There are a lot of network
> admins there who use WMI.
Randy Birch - 20 Jul 2007 01:36 GMT
Here's a handy WMI tip. Use GetObjectText_ in a loop to blast out the
property name and value of each valid item in a particular WMI thingamabob.
For example:
Private Sub Command1_Click()
Dim objset As SWbemObjectSet
Dim obj As SWbemObject
On Local Error Resume Next
Set objset =
GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_NetworkAdapterConfiguration")
For Each obj In objset
Debug.Print obj.GetObjectText_
Next
End Sub
... which prints out on my windows virtual machine (I'm temporarily running
on a Mac):
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000000] WAN Miniport (L2TP)";
Description = "WAN Miniport (L2TP)";
DHCPEnabled = FALSE;
Index = 0;
InterfaceIndex = 2;
IPEnabled = FALSE;
ServiceName = "Rasl2tp";
SettingID = "{441234F5-DEAA-43CB-A47A-1F1E3DC6F2BC}";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000001] WAN Miniport (PPTP)";
Description = "WAN Miniport (PPTP)";
DHCPEnabled = FALSE;
Index = 1;
InterfaceIndex = 3;
IPEnabled = FALSE;
MACAddress = "50:50:54:50:30:30";
ServiceName = "PptpMiniport";
SettingID = "{737A20C3-2927-422C-9420-698FD1EDC3D1}";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000002] WAN Miniport (PPPOE)";
Description = "WAN Miniport (PPPOE)";
DHCPEnabled = FALSE;
Index = 2;
InterfaceIndex = 4;
IPEnabled = FALSE;
MACAddress = "33:50:6F:45:30:30";
ServiceName = "RasPppoe";
SettingID = "{180F0C5B-E52F-42D0-9872-09CAE6FF6621}";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000003] WAN Miniport (IPv6)";
Description = "WAN Miniport (IPv6)";
DHCPEnabled = FALSE;
Index = 3;
InterfaceIndex = 5;
IPEnabled = FALSE;
ServiceName = "NdisWan";
SettingID = "{7CFE8B49-1A54-47F3-8751-1038D4E3389B}";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000004] Parallels Network Adapter";
DatabasePath = "%SystemRoot%\\System32\\drivers\\etc";
DefaultIPGateway = {"192.168.1.1"};
Description = "Parallels Network Adapter";
DHCPEnabled = TRUE;
DHCPLeaseExpires = "20070720191230.000000-240";
DHCPLeaseObtained = "20070719191230.000000-240";
DHCPServer = "192.168.1.1";
DNSDomain = "phub.net.cable.rogers.com";
DNSEnabledForWINSResolution = FALSE;
DNSHostName = "vbnetvista";
DNSServerSearchOrder = {"64.71.255.198"};
DomainDNSRegistrationEnabled = FALSE;
FullDNSRegistrationEnabled = TRUE;
GatewayCostMetric = {0};
Index = 4;
InterfaceIndex = 8;
IPAddress = {"192.168.1.101", "fe80::1d13:fb87:bca5:ac3d"};
IPConnectionMetric = 1;
IPEnabled = TRUE;
IPFilterSecurityEnabled = FALSE;
IPSecPermitIPProtocols = {};
IPSecPermitTCPPorts = {};
IPSecPermitUDPPorts = {};
IPSubnet = {"255.255.255.0", "64"};
MACAddress = "00:B1:02:0A:AD:39";
ServiceName = "PRLETH";
SettingID = "{6CC3D90E-56CC-42D3-A006-CD2F13506FBD}";
TcpipNetbiosOptions = 0;
WINSEnableLMHostsLookup = TRUE;
WINSScopeID = "";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000005] Microsoft ISATAP Adapter";
Description = "Microsoft ISATAP Adapter";
DHCPEnabled = FALSE;
Index = 5;
InterfaceIndex = 10;
IPEnabled = FALSE;
ServiceName = "tunnel";
SettingID = "{BC59451B-4773-4B77-BDF5-A170BB5A7E79}";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000006] WAN Miniport (IP)";
Description = "WAN Miniport (IP)";
DHCPEnabled = FALSE;
Index = 6;
InterfaceIndex = 6;
IPEnabled = FALSE;
ServiceName = "NdisWan";
SettingID = "{0F0A346A-CCCF-4B31-8132-73FF3D3A087E}";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000007] Microsoft Tun Miniport Adapter";
Description = "Microsoft Tun Miniport Adapter";
DHCPEnabled = FALSE;
Index = 7;
InterfaceIndex = 9;
IPEnabled = FALSE;
MACAddress = "02:00:54:55:4E:01";
ServiceName = "tunmp";
SettingID = "{B86D3AC6-FA5C-45A2-99F1-4C6D4D68B14B}";
};
instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000009] RAS Async Adapter";
Description = "RAS Async Adapter";
DHCPEnabled = FALSE;
Index = 9;
InterfaceIndex = 7;
IPEnabled = FALSE;
MACAddress = "20:41:53:59:4E:FF";
ServiceName = "AsyncMac";
SettingID = "{7FA0D6B0-14D7-4C0D-82CC-53F599839578}";
};

Signature
Randy Birch
MS MVP, Visual Basic
http://vbnet.mvps.org/
Please respond to the newsgroups so all can benefit.
Hi Mike,
now I have a concrete question :-)
I used the WMI to find out everything about the network configuration.
But I don't know how to get the current adapter name.
The sample code I found was:
Set oAdapters = GetObject("winmgmts:").execquery( _
"SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled =
True")
For Each oAdapter In oAdapters
List1.AddItem ""
With oAdapter
' MAC-Adresse
List1.AddItem "MAC:" & vbTab & vbTab & .MACAddress
' IP-Adresse
List1.AddItem "IP:" & vbTab & vbTab & Join(.IPAddress)
' SubNet-Masks
List1.AddItem "MASK:" & vbTab & vbTab & Join(.IPSubnet)
' Default-Gateways
If Not IsNull(.DefaultIPGateway) Then
List1.AddItem "GATE:" & vbTab & vbTab & Join(.DefaultIPGateway)
End If
' DNS - Primary/Secondary
List1.AddItem "DNS:" & vbTab & vbTab & .DNSHostName
' WINS - Primary
If .WINSPrimaryServer <> "" Then
List1.AddItem "WINS Primary:" & vbTab & .WINSPrimaryServer
End If
' WINS - Secondary
If .WINSSecondaryServer <> "" Then
List1.AddItem "WINS:" & vbTab & .WINSSecondaryServer
End If
End With
Do you knwo a good documentation of the WMI, which parameters are available
and so on.Because dragging the object to the variable watch window doesn't
help.Thanks in advance!RegardsJMossler
"MikeD" <nobody@nowhere.edu> schrieb im Newsbeitrag
news:ON5UZQxvHHA.4228@TK2MSFTNGP06.phx.gbl...
>> Hi,
>>
[quoted text clipped - 23 lines]
> Anything specific that you need to know about a system, you've got to tell
> us.
Danny - 20 Jul 2007 07:06 GMT
Hi Randy,
Hey cool. Thanks!
Regards
Danny
> Here's a handy WMI tip. Use GetObjectText_ in a loop to blast out the
> property name and value of each valid item in a particular WMI
[quoted text clipped - 241 lines]
>> tell
>> us.