Execute-Process

I’m needing some help on deploying an .exe with some parameters. Below is the code I’m trying to use:
Execute-Process -Path “Setup.exe" -Parameters ‘-f silent.ini’

The install starts but is not running with the attached parameters.

Here is the command line that works:
Setup.exe -f silent.ini

Hi Jeff,
You likely need to add a fully qualified path try this:

Execute-process -Path "Setup.exe" -Parameters "-f $dirFiles\Silent.ini"

though you may need to surround $dirFiles\Silent.ini with quotes again depending on the path.

I tried this with how you have it above and with quotes around the $dirFiles\Silent.ini. Neither worked for me. :frowning:

Did you handle the internal quotes inside of the quotes?

You need to use the tick character, the one above the tilda ~ before each double quote that goes inside another set of double quotes. That is an escape character

This is what i have but it’s still not working. The Setup.exe runs but does not run with the specified parameters.

Execute-process -Path “Setup.exe” -Parameters “-f”$dirFiles\silent.ini""

Hopefully this displays right, basically wrapping $dirFiles\silent.ini with the tick mark before the double quotes.

Execute-process -Path “Setup.exe” -Parameters “-f “$dirFiles\silent.ini”"

Took a screen shot since I cant get the formatting right

Direct path to image:

If mine or Buster’s suggestions done work, please copy your script here, also the log file you’re seeing.
The default log location is c:\windows\logs\software.
Just do a copy and paste into the window.