I’m writing an applescript so that when students log into the machines, it will remove the local user profile folders like:
And create a symlink that points these folders to a NAS but when the script gets to:
do shell script (“rm -rf /Users/$USER/Music”) users get a ‘Permission denied’ error message.
I tried using do shell script (“rm -rf /Users/$USER/Music”) with administrator privileges as well as
do shell script (“sudo rm -rf /Users/$USER/Music”) but it then prompts the user to enter their password.
Is there a way to avoid the password input without adding username ‘name’ password ‘yourpassword’ with administrator privileges. I don’t like the idea of putting username and passwords into a file that can be viewed to see these credentials