Jump to content
Macro Express Forums

Need one-click sleep


Recommended Posts

There's a sleepcomputer command but I couldn't get it to work. It had no effect for me at all.

 

I know of a command line using shutdown with arguments but you also need to first disable hibernation. This worked on my not-updated desktop PC but not on my new tablet. Numerous tests make me think Microsoft have tried to disable/discourage sleep (sleep no longer worked in several old freeware programs I tried) and yet it still works from the start menu. In a separate thread I was trying to trigger the menu but this proved unreliable. I had strange results such as getting an accessibility panel instead, and both my physical and virtual keyboard no longer worked in most (not all) areas of the Macro Express editor. I think I even couldn't type in Notepad! Only a reboot cleared it.

 

Any suggestions how I could get either the Macro Express sleepcomputer to work, or how I could reliably trigger sleep from the secondary start menu (whatever it's called.) I was using WIND & WINU and 50ms keypresses and the menu came up but keypress u did not invoke the shutdown submenu nor did s trigger sleep. I've even tried multipole arrow downs but that proved unreliable.

Link to comment
Share on other sites

Do you mean the command line command for sleeping the computer or the MEP command?

Are you running MEP with elevated privileges? IOW "Run as administrator".
Some good posts here on how to start MEP that way automatically. Just search for the thread. 

Link to comment
Share on other sites

Many keyboards or buttons on laptops exist for sleep. Might check to see if you have one. And you know you can define the function of your buttons to sleep or whatever you want. IE the power button can sleep instead of shutdown. Just an idea for you. 

Also you could do the keystrokes Win+X u s to sleep via the power menu

Link to comment
Share on other sites

FYI I am not running MEP with elevated privileges and when I execute the Sleep Computer command in a macro it sleeps.

If it were me and my macro wasn't doing the sleep, I'd figure out why this doesn't work first.

Link to comment
Share on other sites

Assuming you are running Win11, is it updated? A change in the way Sleep is called is all I can think of right now. I mean, it's odd that so many freeware programs no longer work when presumably they did before, and the Windows command line method also fails now.

 

I'll check my work again tomorrow; it's too late tonight for me. But I've been trying different ideas for days now without success. It's not as if I just spent 5 minutes making a Macro then gave up.

Link to comment
Share on other sites

2 hours ago, Ben Lunder said:

I was using WIND & WINU and 50ms keypresses

 

This works for me.  Windows 10.  Notice "x" between WIND and WINU.  
I'm sure the delays don't have to be a full one-second -- but maybe more than the 50ms you tried.  
I don't know if Win 11 is different....    

 

Text Type (Simulate Keystrokes): <WIND>x<WINU>
Delay: 1000 milliseconds
Text Type (Simulate Keystrokes): u
Delay: 1000 milliseconds
Text Type (Simulate Keystrokes): s

 

Link to comment
Share on other sites

OK, fresh day, fresh mind, fresh computer after a reboot.

 

The macro is simply 'minimize all windows' (to confirm macro is working) followed by sleepcomputer.

 

I open a couple of windows then trigger the macro from a desktop icon. The windows minimize, but nothing else happens. No error beep or message.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...