Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

machine type from registry and execute msi based on it

Status
Not open for further replies.

stasisaa

IS-IT--Management
Apr 15, 2009
2
US
hi,

let me preface this by saying im not a programmer, never fooled with vbscript before today. but i need a script that does something basic, that probably would take someone with skills five minutes.

i need a script that pulls the model number of a particular workstation (they are all dells), and runs an appropriate MSI installer depending on the result.

ie: if model latitude d830 msiexec d830installer.msi
if model dimension 760 msiexec d760installer.msi

i'm trying to piece code together from a few different places, but im obviously not doing it right. anyone know an easy way to do this? keep in mind im a novice

thanks!
joe
 
a good way to do this is use WMI to get the model and then put some select case statements in to with a for each loop. This is something easy but in order to build it need to know where you are looking to find all the PC and list of all the installs. What I would really do is get a grasp on VBScript yourself before attempting to have a script taken off here and running it in your domain. 2 good books to start with are
"VBS step by step" by Ed Wilson and "advanced VBScript" by Don Jones and Jeffery Hicks. Two good books to get yourself started and give you the ability to write these scripts yourself.
 
You can grab the dell model number like this:

Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems
      Model = objItem.Model
Next
WScript.Echo Model

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
thanks mark, thats pretty much exactly what i was looking for. all i need to do at this point is compare the resulting output "model" to some preset values ("Latitude D830" for example), and get the msi's linked up with if thens.

im not too keen on learning vbscript just to take care of this, but thanks for the advice =)
 
Use a select case statement to check the model type against.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top