Compile Batch Files and Scripts for Intune Use

In a prior post, How to Customize Office with the Office 365 Click to Run Deployment Tools, I covered a few basics of customizing an Office 365 Click to Run install beyond what is supported in the standard configuration.xml file by using a simple Batch (.bat) file. Since Intune doesn’t support processing Batch files or VBS files, today I’m covering how to compile your scripts and batch files into a self contained executable.

There are hundreds of tools out there to compile executable, but we’re going to use the one Microsoft provided along with Windows, the Iexpress Wizard.

  1. Run iexpress.exe as an Administrator
    image
  2. Use the default of “Create new Self Extraction Directive file.”
    image
  3. Use the default of “Extract files and run an installation command”
    image
  4. Name your project.
    image
  5. Select if you want to provide a prompt.
    image
  6. Provide a license prompt if desired.
    image
  7. Add the customized batch file, setup.exe and the customized configuration.xml file. If other files are included, make sure they all have a unique files.
    image
  8. Select the custom batch file for the installation command. Make sure to add the cmd.exe /c as below.
    image_thumb[1]

  9. Select the focus of the app, in this case we will be using Hidden.
    image
  10. Provide a finished message if desired.
    image
  11. Provide a path to save the executable. I’ve run into odd scenarios when saving outside of the work folder where the other files reside, as such I recommend saving the executable in the same folder and not using any spaces.
    image
  12. Configure if a restart is desired.
    image
  13. Save your Self Extraction Directive
    image
  14. Click next to create the package.
    image
  15. Done!
    image

You now have a single .exe that can be run without parameters and can be delivered via Intune.