/build/static/layout/Breadcrumb_cap_w.png

Uninstall a "non standard" application that doesn't install to "Program Files"

There are some programs which do not install to the "Program Files" directory on computers.  Some programs like "Spotify" for this example, install under the users appdata\roaming folder.  For this, an uninstall is not possible by typical uninstall scripts.  For this, I would use a batch file to kill the processes it uses and delete the AppData Folder.

This process can be replicated for other such folders or if you want to remove a specific folder from the user.

First things first:

These instructions are for Windows 7 computers.  All variables may change based on other OSes.

Identify the processes you will need to kill incase your user is using it at the moment you run the script.  For our demo, we are going to go over Spotify.  Spotify uses 2 processes: "spotify.exe" and "spotifywebhelper.exe".  Hang onto these for your script later.

Next we identify the subfolder that the program has installed itself.  In the case of spotify it's C:\users\username\appdata\roaming\spotify.  In short it will be the "%appdata%\spotify" variable.  You will also need this for your script, so keep that in mind as well.

Now to the meat of things.  We want to use the scripting interface to accomplish this task.  

  1. Go to the scripting tab and add a new, "Online KScript", Give it a name and any other fields you want to fill out.
  2. Choose the computer(s) you would like to run this on.  Smart lables come in handy here.
  3. Choose the OS Versions you would like to run this on
  4. Run as User Logged in to console
    1. This is important as the %appdata% variable will only work under this context
  5. Choose your schedule
  6. Task Creation Section
    1. Choose your max attempts
    2. On failure Break or Continue, your choice.  I usually continue for testing purposes
    3. Verify if the directory you want exists, in this demo it's %appdata%\spotify (note %appdata% leads to "c:\users\username\appdata\roaming" so there is no need to add \roaming
    4. On Success
      1. If you want for testing and logging, add a status message such as Spotify Found (optional)
      2. Run a batch file
        1. Name the script
          1. taskkill /f /im spotify.exe (or your other product noted prior)
          2. taskkill /f /im spotifywebhelper.exe (repeat for any other EXEs you need to kill)
          3. rmdir "%appdata%/Spotify" /s /q (this removes the entire spotify directory, replace with your product)
          4. del c:\users\%username%\desktop\spotify.lnk (this removes the shortcut on the users desktop)
          5. Click wait for completion to allow the batchfile to run
          6. Save changes
  7. Save the script and run now or wait for the schedule to happen

There you have it!  Follow these instructions and tweak for your specific programs.  Add other lines to remove other items left behind.  This is just the basics of it.  Below are some screenshots to give a visual on what it would look like in the K1000

 


Comments

  • Just to correct a typo, it's rmdir not remdir.

    Thanks for the tips - gwir 10 years ago
    • Thanks for catching that! - spinuzer 10 years ago
  • Thank you soo much I will run this script - gpuk1234 10 years ago
  • It's rmdir - sorry for the typos - spinuzer 10 years ago
This post is locked
 
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