StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Lua Scripts
 General Action Scripts
 sleep/standby and hibernate command

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Giusepppe Posted - 05/13/2017 : 15:46:57
I am using very poor lines for these scripts. Do you have any better ones?

For sleep, i use this script;
acSendKeys("@")
acDelay(50)
acSendKeys("{TAB}{TAB}{TAB}~{DOWN}~")


For hibernate:

acSendKeys("{DELAY=100}@r shutdown -h{ENTER}")

NOTE: I'm using Windows8.1 with Modern UI.
2   L A T E S T    R E P L I E S    (Newest First)
nober Posted - 12/03/2018 : 11:18:09
Here's what I've come up with based on the link provided by Rob. Note that the first line of code changes the hibernation setting. In other words, if you want to do a manual hibernation after running the sleep script, you need to run the first line of other script, and vice versa, or go to control panel's power options.

To sleep:

acShellExecute('', 'powercfg', '-h off')
acShellExecute('', 'rundll32', 'Powrprof.dll,SetSuspendState Sleep')


To hibernate:

acShellExecute('', 'powercfg', '-h on')
acShellExecute('', 'rundll32', 'Powrprof.dll,SetSuspendState Sleep')
Rob Posted - 07/04/2017 : 11:13:39
Really, the only thing I can think of off the top of my head to use acRunProgram and leverage the command line options Windows has, as shown here:

https://superuser.com/questions/42124/how-can-i-put-the-computer-to-sleep-from-command-prompt-run-menu

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000