How to put a computer in sleep or hibernation or power off?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Alpha_AI
Pro Scripter
Posts: 61
Joined: Wed Sep 19, 2007 9:30 am

How to put a computer in sleep or hibernation or power off?

Post by Alpha_AI » Mon Aug 11, 2008 4:33 am

Powering off a pc.

How do I power off a pc using sleep, hibernate and the classic shutdown?
Kind regards,

Ben

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Aug 11, 2008 7:57 pm

You should be able to use Macro Scheduler's Libfunc> to call Windows API library functions.
Look up ExitWindowsEx On the Microsoft website for power down options.
The following example shuts down all processes and logs off the current user.

LibFunc>user32,ExitWindowsEx,EWEres,0,1

Look up SetSuspendState On the Microsoft website for hibernate options.
I did not try to come up with a hibernate example. Sorry.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts