Determining hardware profiles from script

  • Thread starter Thread starter Kenneth Jensen
  • Start date Start date
K

Kenneth Jensen

I have to run a script (batch file) on our corporate
laptops, that mount either a network share or a local
volume as the E:-drive, according to which hardware profile
the machine was booted in.

I know how to do the mounting, but how do I find out which
hardware profile is the active one?

Is there a key in the registry that tells me either the
GUID or the symbolic name of the profile, or is there any
thing else that indicates this, ie. environment variables
or anything else?

Any help is greatly appreciated.
TIA

Kenneth
 
Kenneth said:
I have to run a script (batch file) on our corporate
laptops, that mount either a network share or a local
volume as the E:-drive, according to which hardware profile
the machine was booted in.

I know how to do the mounting, but how do I find out which
hardware profile is the active one?

Is there a key in the registry that tells me either the
GUID or the symbolic name of the profile, or is there any
thing else that indicates this, ie. environment variables
or anything else?

Hi

From a Google newsgroup search at
http://groups.google.com/advanced_group_search

From: Luc Van der Veken ([email protected])
Subject: Re: What hardware profile am I under?
Newsgroups: microsoft.public.win2000.developer
Date: 2000/08/06

In Win2K, is there a programmatic way (environment var, API call, etc.) to
tell which hardware profile a machine was booted under? I need my app to
behave differently depending on profiles.

You can find out by examining the registry.

The base key is:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\IDConfigDB

In that key there's a DWORD value called "CurrentConfig", which
gives the current profile number.

More information about each profile is stored under a subkey
called "Hardware Profiles", each profile in its own subkey with
the profile number as a 4-digit string as it name: for example if
CurrentConfig = 2, the profile can be found in
....\IDConfigDB\Hardware Profiles\0002.

In that key you can find the name the profile was given when it
was created, in the value "FriendlyName".
--

Luc VdV (MCP, MVP) - http://gallery.uunet.be/lucvdveken/
Subtract a hundred and eleven to get my real e-mail address,
but please: I prefer answers in the group (and often ignore questions by
e-mail)

</quote>
 
Back
Top