Ralph Willgoss
Ralph Willgoss

Reputation: 12163

Failed to install [Name] MsiExec returned: 255, when running an cmd file from Powershell

I'm trying to run an MSI install command from Powershell by using a cmd file.
I create my install command:

msiexec /i [insert here a HUGE amount of param values] /lv install.log /passive

I then write it to temp.cmd and then execute from Powershell as follows:

$exitCode = (Start-Process -FilePath "temp.cmd" -Wait -Passthru).ExitCode

I then get the following error message:

CategoryInfo : OperationStopped: 255:String
RuntimeException FullyQualifiedErrorId
Failed to install [Msi Name] MsiExec returned: 255

What causes this?

Upvotes: 2

Views: 4656

Answers (1)

Ralph Willgoss
Ralph Willgoss

Reputation: 12163

If you try and run the MsiExec command I was having trouble with from the commandline, I get the following error message:

The input line is too long

This error isn't obvious when executed in Powershell and you might think its an issue with MsiExec.

This is a bit of a cryptic error message and relates to cmd.exe having a total commandline length of 8191.
See the Microsoft KB article on cmd length: http://support.microsoft.com/kb/830473

Upvotes: 2

Related Questions