I would like to uninstall software - the developer has provided .bat file for the uninstallation. I am getting error while running the software deployment - Not a valid cmd.exe command. Please specify a run option (use /C or /K option) -
Thank you very much. I was trying to run the batch file as “Uninstall.bat”. But now I have added the command which you have mentioned - “runhidden cmd /K Uninstall.bat”. Now the error is gone and I am able to create the package.
Any recommendation to run a batch file other than software deployment wizard?
If it’s a fairly simple script/batch file is or if it’s one that you may want modify frequently you can create the file in the action without having to upload it.
delete __appendfile
delete c:\windows\temp\uninstall.bat
appendfile {concatenation "%0d%0a" of ("start /w msiexec /x" & name of it & " /qn REBOOT=ReallySuppress") of keys whose (value "DisplayName" of it as string as lowercase contains "java" AND (value "Publisher" of it as string as lowercase contains "oracle" OR value "Publisher" of it as string as lowercase contains "sun") AND value "DisplayName" of it as string as lowercase does not contain "java auto updater" AND value "DisplayVersion" of it as string as version < "8.0.1810.13") of keys "hklm\software\microsoft\windows\currentversion\uninstall" of (x64 registries;x32 registries)}
copy __appendfile "c:\windows\temp\uninstall.bat"