Is it possible to shutdown your computer through a button?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Paul D
Posts: 116
Joined: Mon May 21, 2007 6:58 pm

Is it possible to shutdown your computer through a button?

Post by Paul D » Thu May 31, 2007 6:36 pm

Im searching through the Language reference and the user guide but I dont see a command or a way to execute a computer shutdown on a button click. Maybe I am missing something?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu May 31, 2007 10:35 pm

Dear Paul,

Windows XP:
get shell("shutdown -s")

Mac OS 9 and X, AppleScript:
tell application "Finder" to shut down

or "embedded" in Transcript:
do "tell application" && quote & "Finder" & quote && "to shut down" as AppleScript

Unix, Linux and Mac OS X:
get shell("shutdown -h")

Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Paul D
Posts: 116
Joined: Mon May 21, 2007 6:58 pm

Post by Paul D » Fri Jun 01, 2007 1:22 pm

How bout one for windows 2000?

Post Reply