• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shutdown/Restart computer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shutdown/Restart computer


  • Subject: Re: Shutdown/Restart computer
  • From: vinai <email@hidden>
  • Date: Mon, 14 Sep 2009 18:14:19 -0700 (PDT)

A call to the system command, like:

    system ("sudo /sbin/shutdown -h now');

You'd have to make sure your user is authenticated to use shutdown via sudo ...

I'm not sure if there's a cleaner way specific to OS X.  The above should work a reasonable portion of UNIX and UNIX-type systems.

vinai

--- On Mon, 9/14/09, PCWiz <email@hidden> wrote:

> How would I shut down and restart the computer using Objective-C code?
>
> Thanks





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Shutdown/Restart computer
      • From: Kyle Sluder <email@hidden>
References: 
 >Shutdown/Restart computer (From: PCWiz <email@hidden>)

  • Prev by Date: Re: Help book content
  • Next by Date: Re: adding a page curl transition
  • Previous by thread: Shutdown/Restart computer
  • Next by thread: Re: Shutdown/Restart computer
  • Index(es):
    • Date
    • Thread