I'm running the following batch file to remove the splunk agent version 9.2.1 and works well. But, I'd like it to work for all versions so I don't have to modify the batch file as the version changes. Here is my batch file:
msiexec /x "%~dp0splunkforwarder-9.2.1-78803f08aabb-x64-release.msi" /quiet
So far, I've tried the option below with no success msiexec /x "%~dp0splunkforwarder-*.msi" /quiet
Please help. Thank you.
You can use a for command :
for %%f in ("%~dp0splunkforwarder*.msi") do msiexec /x "%%f" /quiet