Disable Saved Application States OS X Lion

greatkemo
Contributor II

Folks,

I have been messing about with this for a few days and it has done my nut in, but finally got it to work just like I want it so I decided to share the joy.

I set out to do 2 things, (1) Disable this "Saved Application States" lion brought as it is really annoying, especially with finder issues when mounting user shares using ADmitMAC. (2) Disable reopening windows when logging back in.

So I stumbled across this link:
http://hints.macworld.com/article.php?story=20110918051930924
Very Useful, but it took a little tinkering to get the right outcome, so I modified it slightly in shell script:

#!/bin/sh
/bin/rm -r /Users/*/Library/Saved Application State/*
/bin/chmod -R a-w /Users/*/Library/Saved Application State/
/usr/bin/defaults write com.apple.loginwindow TALLogoutSavesState -bool false
/bin/chmod a-w /Users/*/Library/Preferences/com.apple.loginwindow.plist
/usr/sbin/chown root /Users/*/Library/Preferences/com.apple.loginwindow.plist
/bin/rm -r /Users/*/.Trash

I just then added it as login/logout script using casper policies.

Try it out, it could be very useful.

Kamal

0 REPLIES 0