Restarting OS X in Single User mode via AppleScript

Hi ,

How to write a script using which i can restart my OS X in Single User mode ?

thanks in advance

Hi,

You can’t do this. Only the kernel and keyboard control are available at boot time.
For security reasons that’s good how it is :wink:

ok The problem i am facing is that i have PPC G5 machine for which i am using a PC Keyboard, using which i wont be able to boot in Single User mode. I need to have a Apple keyboard to boot into Single User mode. Is there any other alternative ?

sorry I don’t have any experience with non-Apple hardware

Hello bufferoverflow

Currently I am using a Mac mini with a PC keyboard. As far as I have tested, I can start up OS X in single user mode by pressing Windows Key+S at the same time immediately after you turn on your computer.
This article might help.
http://support.apple.com/kb/HT1492

Kim

Hi

I think I found one now. When I was reading the manual pages for nvram, I found an example describing it. You should read the manual pages as well. (“man nvram”)
To start up in single user mode, you should:

sudo nvram boot-args="-s"

It’s probably preferable to write such a script in Shell, but you can use AppleScript and add a “do shell script”.

I haven’t tested that, but hope it helps.