Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created May 27, 2022 15:39
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talkingmoose/08c279ab87250299ab602bf44493da91 to your computer and use it in GitHub Desktop.
Save talkingmoose/08c279ab87250299ab602bf44493da91 to your computer and use it in GitHub Desktop.
Remove a drag-and-drop application before performing another task such as a software update.
#!/bin/zsh
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/bd4abab222685c4e3781967a4d0491f6
Originally posted: August 14, 2017
Purpose: Remove a drag-and-drop application before performing
another task such as a software update.
Except where otherwise noted, this work is licensed under
http://creativecommons.org/licenses/by/4.0/
"I want to see you out that door
Baby bye bye bye."
INSTRUCTIONS
1) Log in to the Jamf Pro server.
2) Navigate to JSS Settings > Computer Management > Scripts.
3) Click the " + " button to create a new script with these settings:
Display Name: Quit Application
Category: <your choice>
Notes: Remove a drag-and-drop application before performing
another task such as a software update.
Script: < Copy and paste this entire script >
Options tab:
Priority: Before
Parameter 4: Path to application
4) Save the script.
5) Add the script to a policy and set it to run before modifying
the application.
-----------------------------------------------------------------------
ABOUT_THIS_SCRIPT
/bin/rm -Rf "$4"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment