Joe Taylor
Joe Taylor

Reputation: 579

Batch script using msiexec can't find relative file to run

I have a batch script inside a folder alongside a .msi file which I want it to run, however both these lines:

msiexec.exe /i /L*V "%~dp0\UE4PrereqSetup_x86.msi"
msiexec.exe /i /L*V "%~dp0UE4PrereqSetup_x86.msi"

return this error:

This installation package could not be opened. Verify that the package exists...

The batch script and .msi are both inside C:\Users\jm_ta\Documents\test\ and Echo %~dp0 does print out that filepath exactly.

Any ideas what I'm doing wrong?

Upvotes: 1

Views: 2403

Answers (1)

Bob Arnson
Bob Arnson

Reputation: 21896

The path to the package must come after the /i. Move the /l*v before the /i or after the path.

Upvotes: 1

Related Questions