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.  ???

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

2

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

Answered 12/19/2012 by: SMal.tmcc
Red Belt

Please log in to comment
2

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)
What about:
  • (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
Answered 12/20/2012 by: GillySpy
Seventh Degree Black Belt

Please log in to comment
1

yes, as SMal.tmcc says, use the productcode for the uninstall and call it as normal MSI, msiexec /x {xxx} /qb

Answered 12/20/2012 by: mac-duff
Second Degree Blue Belt

Please log in to comment
This content is currently hidden from public view.
Reason: Member has been banned from the site
For more information, visit our FAQ's.

0

Not sure why you are using shell scripts, but did you change the "Script File Name" from script.sh to script.bat?

Answered 12/19/2012 by: dugullett
Red Belt

Please log in to comment
This content is currently hidden from public view.
Reason: Removed by member request
For more information, visit our FAQ's.

0

User rights to the path as everyone said. Easiest way to keep using the script is a dependency. But as noted here there are several ways to approach. 

Answered 12/20/2012 by: jdornan
Red Belt

Please log in to comment
-1

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.

Answered 12/19/2012 by: gcarpenter
Green Belt

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