|
|
10.5: Delete users accounts from command line in 10.5
Here's a little script I wrote that will clear user info on recent versions of OS X. Drop it in the root level of the hard drive, then boot to single user mode and run it.
Please note that I hard coded the user account; someone could easily modify it to find it automatically or as a command line argument. Also the script removes itself, and the name and location are hardcoded, so adjust those as well. My scripting is pretty rusty but it gets the job done; I'd love to see someone clean it up a bit. Really wish this functionality could get rolled into AppleJack... PS - I'm sure I looked at the same sources as the OP when I wrote this - I don't want to take credit for the methodology. ======================================
10.5: Delete users accounts from command line in 10.5
Just noticed my account name on the original post. I didn't even realize that was my submission! I sent it in a LONG time ago (at least in 'net time). So sorry for commenting on my own hint w/o realizing it!
10.5: Delete users accounts from command line in 10.5
excuse my ignorance with this script/command line stuff:
10.5: Delete users accounts from command line in 10.5
Two simple changes to address the two issues of your script (the hardcoded user name and script name):
10.5: Delete users accounts from command line in 10.5
bcmeta-
10.5: Delete users accounts from command line in 10.5
"Do you know off-hand if the "id" command and "$0" variable work consistently with 10.3 & 10.4? As you can see I'm trying to keep the script flexible enough to use with all the OS's we're likely to need it with."
10.5: Delete users accounts from command line in 10.5
Thanks... of course I just did a little testing and it looks like the id command won't work in single user mode without starting netinfo/directory services. Not a problem for 10.5 since that has to be done anyway, but I guess I'll have to see about starting & stopping netinfo in 10.3 & 10.4. I'm not sure it's worth the trouble - starting to wonder if listing the user directory might be easier! |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|