Scripting isn't working correctly
I created an online shell script to uninstall an msi using one line: the /x switch to uninstall it, the .msi path (network share) and /q for quiet. I kept getting a 193 error. When I copied the command line exacly as in the Kace into the Run box of a node, it worked. ???
Answers (6)
if you are running it as system it cannot see the share. You should be to verify the existance of the program under verify and run the uninstall from the msi on the local box from the install. Look in the registry under hklm\software\microsoft\windows\currentversion\uninstall\the keyset for this software and look for a key callled UninstallString use the directory and exe and parameters for the launch a program portion of the script
Sounds like it cannot find the msi. There is little advantage to putting the file on the network share since Windows is going to copy that file to %tmp% anyway.
If you are bent on referencing it from a network share then you'll have to either:
- run the script as a user that has those priviledges (online script has run as options)
- add run as logic or network drive mapping into your batch file
- make the share accessible to machine accounts (it's possible, but do NOT do this)
- (most common) creating a managed install instead with the "configure manually" option which will reveal some un-install options including a payload-free option.
- attaching it as a dependency to the script? in this case the agent will copy it to the machine but windows was doing that anyway for the network based file.
- use kbox replication for the file: replication consumers will download the script dependency from the replication file share automatically.
- Looking at how it shows up in software inventory of the kbox. To avoid ambiguity: open the computer inventory; find the item in the list of install programs; click on it. You'll see an entry in the detail called Product Un-install command and it will contain the product code version of the uninstall. Something like:
MsiExec.exe /x{85F4CBCB-9BBC-4B50-A7D8-E1106771498D} /qn
if you can't find it on the kbox then you can go to a machine to get it like SMal.tmcc said
yes, as SMal.tmcc says, use the productcode for the uninstall and call it as normal MSI, msiexec /x {xxx} /qb
You are going to have to show us, man. Problem with OSS is that you have to manually open the MSIEXEC.EXE program, rather than just do a CMD line: msiexec /x example.msi /q. Plus the MSI has to match the installed program (usually).
Finally, check under RUN AS: at the top of the script page to see if you are running it as SYSTEM. If you are running as a User, they may not have the rights available. You should try Run As User: and put in your credentials.