/build/static/layout/Breadcrumb_cap_w.png

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


0 Comments   [ + ] Show comments

Answers (6)

Posted by: SMal.tmcc 11 years ago
Red Belt
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

Posted by: GillySpy 11 years ago
7th Degree Black Belt
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
Posted by: mac-duff 11 years ago
Second Degree Blue Belt
1

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

Posted by: dugullett 11 years ago
Red Belt
0

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

Posted by: jdornan 11 years ago
Red Belt
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. 

Posted by: gcarpenter 11 years ago
Green Belt
-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.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ