I'm having a little problem with some drivers on my different machines using system images.  Some of the newer HPs won't install thing like audio or the hot keys because they don't show up in device manager with errors.  I want a single WIM image for all of our production machines.  To make it work I came up with a VBS that checks the system WMI then kicks off the installer for the appropriate hardware as a post install task.  It works nice - except stinking windows is pulling up the box that says it can't verify the app developer and I need to click to install the software.  Any ideas on how to suppress this pop up?  I've tried running it as a windows script and a calling it with a bat but it's popping up and causing my image to require user intervention.  

 

Here is the script I'm calling these with:

 

On error resume next

 

Dim strComputer, objWMIService, strmodel, colmodel, objitem

 

    strComputer = "."

 

    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

 

    Set colmodel = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")     

 

    set objShell=wscript.createObject("wscript.shell")

 

'Install Model Specfic software / Drivers

 

For Each objitem in colmodel

 

        'wscript.echo objitem.model

 

            Select Case trim(objitem.model)

 

                Case "HP ProBook 640 G1"

 

                   ' wscript.echo "Machine type HP Probook 640 G1"

 

                    ObjShell.Run(“\\server\share\Drivers\windows_7_x64\HPProBook640G1\Audio\setup.exe -s"),1,true

 

                   wscript.quit 

 

                     Case Else

 

                      ' Wscript.echo "Computer Type Unknown"

 

            End Select

 

Next

 

Thanks for any thoughts!

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0

I can't answer the VB question, but I have a .bat script that does the same. I have a separate folder for each model needed (ie model1, model2, model3). I ZIP those, and have a .bat file like the one below that installs.

@ECHO OFF
REM do a wmi query to get the info we want and put it in a variable
FOR /F "tokens=2 delims==" %%A IN ('WMIC csproduct GET Name /VALUE ^| FIND /I "Name="') DO SET machine=%%A


rem ########## Model 1 #############
IF /I "%machine%" == "Model1" goto Model1

rem ########## Model 2 #############
IF /I "%machine%" == "Model2" goto Model2

rem ########## Model 3 #############
IF /I "%machine%" == "Model3" goto Model3
goto End

:Model1

INSTALL SOMETHING IN MODEL1\SETUP.EXE

goto End

:Model2 

INSTALL SOMETHING IN MODEL2\SETUP.EXE
goto End

:Model3

INSTALL SOMETHING IN MODEL3\SETUP.EXE
goto End

:End

Answered 04/17/2014 by: dugullett
Red Belt

  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
Please log in to comment
Answer this question or Comment on this question for clarity