Scripting Question

Is there a way to delete a directory on a Mac using a script?

09/14/2015 1549 views
I often see ways of doing this on the windows side, but I'd like to be able to remove a folder on a students MAC OS X machine (specifically a Java folder) that is causing issues and the fix is to remove it, but touching just about 500 computers is painful. The folder location would be the same on each computer.


1 Comment   [ + ] Show comment


  • You can write a bash script that would remove the folder.

All Answers

Edit:  I completely missed the fact that you were asking about a Mac.

The easiest way to do this would probably be by using an online shell script that runs something like:

rm -r /your/file/location


You could use the "Launch a Program" task to call something like: rd /S c:\your\file\location

Alternatively, you could upload a batch file that deletes the directory as a dependency and call that.

The one caveat to this would be to see if LocalSystem has rights to delete the location.  If not, you would need to specify a user that does under the Run As section of the kscript.
Answered 09/15/2015 by: jknox
Red Belt

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