I am trying to add a PO task that will install the latest version automatically, without having to modify the PO task every time an agent upgrade happens and can't figure out the correct wildcard syntax. Should be simple, but I am striking out.

A few that I tried:
msiexec /i "\\k1host\client\agent_provisioning\windows_platform\ampagent-*.*.***-x86.msi" HOST=k1host
msiexec /i "\\k1host\client\agent_provisioning\windows_platform\ampagent-*-x86.msi" HOST=k1host
msiexec /i "\\k1host\client\agent_provisioning\windows_platform\*.msi" HOST=k1host

However when I added the version info explicitly like this it worked:

msiexec /i "\\k1host\client\agent_provisioning\windows_platform\ampagent-8.0.152-x86.msi" HOST=k1host

Any ideas?

Answer Summary:
0 Comments   [ - ] Hide Comments


Please log in to comment

Answer Chosen by the Author


Using chucks answer as a guideline, I cobbled this batch file together and it works well:
for %%f in (\\k1host\client\agent_provisioning\windows_platform\*.msi) do (
msiexec /qb /i "\\k1host\client\agent_provisioning\windows_platform\%%~nf.msi" HOST=k1host

Thanks Chuck!

Answered 12/04/2017 by: five.
Second Degree Blue Belt

Please log in to comment
Answer this question or Comment on this question for clarity


The msiexec command doesn't accept wildcards. You could use the for command to identify the msi file in the folder and run the msiexec command on that file. 
Answered 12/01/2017 by: chucksteel
Red Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja