(Need Help) Scritp to silent install MSI, MSU & CAB files from a folder with subfolde

Discussion in 'Windows 7' started by yro, Oct 8, 2014.

  1. yro

    yro MDL Senior Member

    Jul 26, 2009
    477
    83
    10
    #1 yro, Oct 8, 2014
    Last edited: Oct 8, 2014
    Hi guys.

    I need some help, if possible.

    I want to make a script to silent install several files from a folder with subfolders. The files will be MSI, MSU and CAB. The script need to check if the file was installed and if so the scritp will ignore the installed ones. Maybe a log file could be created so the script can check it.

    The idea is to have a folder with windows 7 updates and microsoft aplications (like IE and .NET frameworks) and a script (in powershell or anything else) that will install one by one, in silent mode, but showing on the prompt screen the status of each file installed and ignoring the installed ones.

    Is that possible? If so, can somebody help me with it? I have no skills on scripting :(

    This will be great for me so I can use it with my clients and on the enterprise that Im working these days. So when microsoft launches a new update I put the file on that folder and run the script.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,686
    10,145
    210
    #2 murphy78, Oct 8, 2014
    Last edited by a moderator: Apr 20, 2017
    I have no experience with msi installers, but something like this could work for msu and cabs:
    Code:
    @echo off
    pushd "%~dp0"&cd /d "%~dp0"
    forfiles /m *.msu /s /c "cmd /c echo === Installing @FNAME ===&wusa @FILE /quiet /norestart"
    forfiles /m *.cab /s /c "cmd /c echo === Installing @FNAME ===&dism /online /add-package /packagepath:%CD%\@FNAME.cab"
    You see the part I put in Red? If you find the correct method to install msi installers, you would insert it there and change the /m call to /m *.msi

    You'd have to test this stuff though... I'm by no means an expert on this stuff.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. yro

    yro MDL Senior Member

    Jul 26, 2009
    477
    83
    10
    Thanks.

    I will try to evolve this and post results and scripts here. This has potential to be a great add to the forum. A lot of users will be like me and prefer to use this kind of method instead of merging updates and softwares with tools like ntlite or dism.

    Im at work right now. Ill try the script later today.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Magissia

    Magissia MDL Novice

    Dec 25, 2012
    15
    1
    0
    Any updates on this ?
     
  5. coleoptere2007

    coleoptere2007 MDL Guru

    Apr 8, 2008
    2,357
    1,206
    90
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...