PDA

View Full Version : Creating Hardware profiles using VB Script (W2K)



ScottSouthgate
04-23-2004, 01:55 AM
Hi,

I would like to write a script to configure laptops with several hardware profiles. The objective is to have the same naming convention and order of profiles (at startup on all the company laptops).

Is this possible to do with VB Script, as it seems the hardware profiles are stored in the registry.

Any help on this would be greatly appreciated.


Regards,

Scott S.

dineshcooper
04-23-2004, 02:12 AM
Yes you can, if what you're asking is whether it's possible to set values in the registry using vbscript then the following code allows you to do that

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_CURRENT_CONFIG\MyKey\MyVal", "ThisVal"

that would create a value called MyVal in the sub key HKEY_CURRENT_CONFIG\MyKey containing the value "ThisVal"

If you would like a vbscript that can be called from the command line with parameters to write keys and values, I could email you one that I have written.

Hope that helps
Cheers
Dinesh