Skip to content

Instantly share code, notes, and snippets.

@prashanthrajagopal
Created June 20, 2014 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prashanthrajagopal/36f7e0631a3450e4d571 to your computer and use it in GitHub Desktop.
Save prashanthrajagopal/36f7e0631a3450e4d571 to your computer and use it in GitHub Desktop.
Applescript to enable Auto Login in OSX
set username to do shell script "whoami"
set uid to do shell script "id | cut -d' ' -f1 | cut -d'=' -f2 | cut -d'(' -f1"
do shell script "/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser " & username with administrator privileges
do shell script "/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow autoLoginUserUID " & uid with administrator privileges
display dialog "User " & username & " is now the default Auto Login."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment