Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jacklevics

macrumors newbie
Original poster
Nov 9, 2022
6
0
Hi,

I am trying to set up Macs for my school on Monterey 12.6 and ran into loads of crashing issues regarding Google Chrome and Garageband on Guest (but never on local), plus couldn't get a launch script on Guest to accept default browser.

Is there a way I can create a local account (non-admin) that I can install Drive onto but would subsequently log user out of all programs on sign out/shut down, rather than using Guest that's causing so many issues.

So basically, on sign out, all the programs are signed out, i.e Drive, and users files are reset.
 

bogdanw

macrumors 603
Mar 10, 2009
5,692
2,725
Customizing Login and Logout
https://developer.apple.com/library...l#//apple_ref/doc/uid/10000172i-SW10-BAJCGEGG

From the admin account, place the script you want to be run at log out in /Users/Shared/, then run
sudo defaults write com.apple.loginwindow LogoutHook /Users/Shared/script

Here is an example:
-script /Users/Shared/standard.sh with this content
Code:
#!/bin/zsh
rm -rf /Users/standard/Desktop/test

-make it executable
Code:
chmod +x /Users/Shared/standard.sh
- set to run at log out
Code:
sudo defaults write com.apple.loginwindow LogoutHook /Users/Shared/standard.sh

Now at every log out, regardless of the user that logs out, the folder /Users/standard/Desktop/test will be deleted.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.