Introduction:
If your Macintosh computer needs to be reset to factory defaults due to OS errors, or any other reason, you can use a series of commands to accomplish this.
Requirements:
Local access to a Macintosh computer.
Procedure:
Boot OS with Power button.
Then hold cmd & S.
Press enter once get to root prompt.
At the prompt, type:
mount -uw /
rm /var/db/.AppleSetupDone
shutdown -h now