Remove User with script to factory experience (all updates and iLife)

Discussion in 'Mac Programming' started by fxscreamer, Mar 7, 2011.

  1. fxscreamer macrumors member

    Oct 12, 2008
    Ok, so I've been searching everywhere for the actual code, but I know this can be done, because I've SEEN it done. I just can't remember how. I know it's only about 4-5 lines of code in Applescript.

    What I know

    "username" and "password" to verify
    remove groups
    remove user
    remove applesetupdone
    remove script

    I can't remember the proper commands, but I believe they're in that order. Let's say I just installed Snow Leopard fresh, installed iLife 11, then ran all updates up to 10.6.6. I made an account with a user named "Service" and a password as "apple". This script could sit on the desktop when I was done, double click it, it runs, removes all the user stuff, then the script itself. Now all I do is restart, and perfecto......WELCOME TO OSX SETUP SCREEN (with latest software and updates installed)

    does anyone know the exact code to carry out these commands? I keep running into errors in applescript. It would be greatly appreciated. :rolleyes:
  2. Dalton63841 macrumors 65816


    Nov 27, 2010
    This script was made into an app a while back and I been searching for it myself with NO luck...
  3. fxscreamer thread starter macrumors member

    Oct 12, 2008
    Got the code



    echo "apple" | sudo -S rm -R /Users/service
    sudo rm /private/var/db/.AppleSetupDone
    sudo dscl . -delete /Groups/service
    sudo dscl . -delete /Users/service

    So just make sure your user is "service" and password is "apple". This was made as an application in applescript. Or you can just change those user values. Whatever you want.

Share This Page