/build/static/layout/Breadcrumb_cap_w.png

INF driver update via K1000 Managed Install

My story so far.  I've been tasked with updating the SATA driver for a bunch of E7440 laptops in our environment as a prerequisite for encryption.

Previously, they've tried pushing out an updated exe package to the machines with a silent install.  However the hardware device never updated it's driver version.

So, I've been given an INF package we've been using to manually update the driver.  I've created a little batch file in a zip with a few things packaged together:

.\x64\devcon.exe  < to force update the hardware list after installing the driver (note these are ALL 64 bit Win7 machines)

.\drv_inst.bat  < my batch file to process the update

.\.inf .cat .sys   < driver files for the SATA controller in the root of the folder


Contents of the .BAT file

pnputil.exe -i -a .\iaStorAC.inf 

.\x64\devcon.exe rescan

echo "Script has run" > C:\run.txt


End of batch file contents


So pnputil updates the driver.  Devcon forces a hardware rescan.  And the echo line is just me testing to make sure the batch is actually running.  (It is, I get the file)


I push this out as a managed Anytime install with the correct ZIP file associated to the install.  I'm using "Override Default Installation" with "drv_inst.bat" and I've checked off "Don't Prepend msiexec.exe"


Added my test machine with an older driver version to KACE and added it to the deploy list.

Ran "runkbot 4 0" from the test machine to force inventory update.  I can see the files are dumped into the downloads folder of C:\ProgramData\Dell\KACE and I see my C:\run.txt file is there.


So here's the problem.  The driver doesn't update.  Still showing the old version of the driver, even after a reboot.

To add insult to injury, I can go to the command line (run as Admin) and navigate to the folder where my batch file is and run it.  THEN the driver shows updated in the Device manager.


So what am I missing here?  I'm so close to making this work I can taste it.  But I feel I'm missing something critical to the process.

I don't want to do a scripted install since I want it to just run when the machines check in, not hope to catch them in script deploy cycle.


Anyone have an idea how to make this work?


Thanks,


Reg


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: rileyz 7 years ago
Red Belt
1
I dont use KACE but you should do your testing with the SYSTEM account. Presuming KACE uses a system account here to run its actions on remote machines etc.

Using psexec is the easiest method to spawn a SYSTEM contect console.
https://blogs.technet.microsoft.com/askds/2008/10/22/getting-a-cmd-prompt-as-system-in-windows-vista-and-windows-server-2008/

Next, have you thought about using DpInst for driver injection? I think this will also allow a rescan and a update? Worth a thought anyway and I think the documentation for DpInst will be better - its also newer too.

Comments:
  • Good point about the SYSTEM account. I'll be checking that after I reimage my test machine again.
    As for DPINST, that tool didn't come up in my initial web searches. I was hoping to avoid using another tool but if it does the job, I'll be happy.
    If it IS the SYSTEM account that's causing the problem, is there a way to run the batch (or individual lines in the batch) as a different user? That would be the ideal solution at this point in time.

    Thanks for your post! - Endar 7 years ago
    • If it is a SYSTEM account issue (unlikely) then you're best to use another tool to do the driver injection. There should be no need to use a named account to manage the drivers, its also a security concern having named accounts with that access privilege. Anyway that a side I did some research awhile back, which now eludes me but DpInst came out on top but I think it might be the new way to manage drivers?

      Here's a link to the DPInst, the exe's are signed by MS etc etc so safe, it will be there for 3 days before I remove it. Saves download 3gb of WDK for two tiny things (:

      https://dl.dropboxusercontent.com/u/13973308/Driver%20Package%20Installer.zip


      Just had an idea, you might want to check you're in the right dir before you run the script, as force the CD into current location. Sometimes the console will dump you into C:\Windows\System which is a useless place to be (;

      Also like my like my old Infra Tech guy says to me - LOG LOG LOG! So you know whats going on, capture the exitcode so you know if it ran...or in your case not :P - rileyz 7 years ago
      • I didn't get a chance to try this before I left on Friday. And thanks to rad33k's post yesterday, my initial deployment method is now working.

        I wanted to thank you again for your assistance and for going above and beyond to grab those files for me. (I agree, 3GB is an insane amount to download for a couple of files)

        You were absolutely right about the logging. And now that I have some examples how to do it properly, I'll make sure to do a proper job of it going forward!

        You can see the log results in my reply to rad33k, I was in the right folder but running the wrong version of PNPUTIL.exe Forcing the path to the app made the difference, but logging made it obvious.

        So, lesson learned. Kudos all around for two super helpful IT comrades and I've got some new tools and knowledge for my IT toolbox.

        Cheers,

        Reg - Endar 7 years ago
Posted by: rad33k 7 years ago
Fourth Degree Brown Belt
0

Top Answer

+1 for rileyz post and comments.I would also add :
- use a quotation marks for all file paths
- verify if it is not caused by the execution context (32 vs. 64 bit) - When you launched your batch file in CMD it was started in a 64bit context. If you are not sure how deployment is started try with this one: "%WINDIR%\SYSNATIVE\PNPUTIL.exe" to call executables from System32 (64bit) in case of 32 bit distribution.
- "LOG LOG LOG, capture the exitcode" and redirect command's output into a TXT file
- "..to check you're in the right dir" and/or use a full paths by adding %~dp0 for files next to the BAT file

See suggested drv_inst.bat contents:

@Echo Off
pnputil.exe -i -a "%~dp0iaStorAC.inf" > C:\run.txt
echo "PNPUTIL fisnihed with exit code: " %ErrorLevel% >> C:\run.txt
"%~dp0x64\devcon.exe" rescan >> C:\run.txt
echo "1st part finished" >> C:\run.txt
"%WINDIR%\SYSNATIVE\PNPUTIL.exe" -i -a "%~dp0iaStorAC.inf" >> C:\run.txt
echo ".\SYSNATIVE\PNPUTIL fisnihed with exit code: " %ErrorLevel% >> C:\run.txt
"%~dp0x64\devcon.exe" rescan >> C:\run.txt
echo "2nd part finished" >> C:\run.txt

and then check the C:\Run.txt for more information.


Comments:
  • SUCCESS! So the problem appears to have been the version of PNPUTIL that my batch was running.

    Thanks so much for your batch file modification. The results in run.txt told the whole story. It should've twigged to me that since the txt file was created in the first place that it had to be one of the lines not processing correctly, since the batch was obviously running.

    Also, I've got very little experience in capturing logs so your batch file code was a real eye-opener.
    %~dp0 was new to me and I'm sure I'll be using it a lot going forward.

    Not sure how to add a box around my output from run.txt like you did with the batch but here's my results for those who are curious.

    *****Beginning of RUN.TXT*****

    "PNPUTIL finished with exit code: " 9009
    Scanning for new hardware.
    Scanning completed.
    "1st part finished"
    Microsoft PnP Utility

    Processing inf : iaStorAC.inf
    Successfully installed the driver on a device on the system.
    Driver package added successfully.
    Published name : oem165.inf


    Total attempted: 1
    Number successfully imported: 1

    ".\SYSNATIVE\PNPUTIL fisnihed with exit code: " 0
    Scanning for new hardware.
    Scanning completed.
    "2nd part finished"


    *****End of RUN.TXT*****


    So thanks again. You've answered my question and got me able to start the next step in my deployment.

    Reg - Endar 7 years ago
    • Cheers :) I'm glad I somehow helped you.
      Good Luck! - rad33k 7 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ