Ben Lunder Posted April 11, 2023 Report Share Posted April 11, 2023 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. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 11, 2023 Report Share Posted April 11, 2023 Why doesn't the built in MEP command "Sleep Computer" work for you? Quote Link to comment Share on other sites More sharing options...
Cory Posted April 11, 2023 Report Share Posted April 11, 2023 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. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 11, 2023 Report Share Posted April 11, 2023 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 Quote Link to comment Share on other sites More sharing options...
Cory Posted April 11, 2023 Report Share Posted April 11, 2023 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. Quote Link to comment Share on other sites More sharing options...
Ben Lunder Posted April 11, 2023 Author Report Share Posted April 11, 2023 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. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 11, 2023 Report Share Posted April 11, 2023 Microsoft forbids me from upgrading to Win11. Quote Link to comment Share on other sites More sharing options...
rberq Posted April 11, 2023 Report Share Posted April 11, 2023 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 Quote Link to comment Share on other sites More sharing options...
Cory Posted April 11, 2023 Report Share Posted April 11, 2023 I didn't try it rberg. I'm glad you found some delay was needed. If the MEP command for sleep isn't working, it shoudl be reported as a bug. https://www.macros.com/bugreport/ Quote Link to comment Share on other sites More sharing options...
Ben Lunder Posted April 12, 2023 Author Report Share Posted April 12, 2023 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. Quote Link to comment Share on other sites More sharing options...
Ben Lunder Posted April 12, 2023 Author Report Share Posted April 12, 2023 Woohoo! Success! Thanks Rberq. I tried your method with the delays and it works. I'll try cautiously reducing the 1000ms later to see what is reliable. Quote Link to comment Share on other sites More sharing options...
Cory Posted April 12, 2023 Report Share Posted April 12, 2023 Huh. I thought it was my method. Oh well. Quote Link to comment Share on other sites More sharing options...
rberq Posted April 12, 2023 Report Share Posted April 12, 2023 58 minutes ago, Cory said: Huh. I thought it was my method. We will file the patent application in both names.😋 Quote Link to comment Share on other sites More sharing options...
Cory Posted April 12, 2023 Report Share Posted April 12, 2023 LOL. Naw you can have the credit. All good. Apparently my other messages were of no value either. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.