[Batch Script] Extract all Inno Setup Wizard EXE Files in Directory

Discussion in 'Scripting' started by HHo2016, Sep 8, 2020.

  1. HHo2016

    HHo2016 MDL Member

    Sep 10, 2016
    174
    126
    10
    Note: Script requires "innoextract", which you can download HERE: https://constexpr.org/innoextract/.

    I used the script below to quickly extract all of the Lenovo driver packages created using Inno Setup that I had stored in a folder without having to run each one manually to extract its contents.

    Code:
    @ECHO OFF
    CD /D "%~DP0"
    TITLE Extractor for Inno Setup
    echo.
    echo Extracting all .exe files in this directory...
    echo.
    for %%a in (*.exe) do (
        echo Extracting contents from %%a...
        innoextract.exe "%%a" -d "%%a_EXT"
    )
    echo.
    echo Extraction complete.
    echo.
    echo Press any key to exit...
    echo.
    pause >nul
    exit
    
    Note: If your folder path name length is too long, then extraction of installer contents will fail - if this happens, move your folder to the root directory of your drive.