Share via

Doing something by CMD

Little Sun 21 Reputation points
2020-12-19T18:36:49.18+00:00

Hello everyone. I'm a half of programmer from Taiwan (In fact I'm a tester.). Then , I have some ideas which need command lines and some problems , please help.

  1. How to sleep by CMD? I use " rundll32.exe powrprof.dll,SetSuspendState 0,1,0 " but it do nothing. By the way , I use " powercfg /h on " to check it , the computer can hibernate correctly. According to the situation , I use " powercfg /a " to check , it shows the message " The system fireware does not support this standby state. " with s1,s2,s3. However , I can let it sleep by Win-power-sleep item correctly. So , what should I do to set?
  2. Can I let computer wake up by itself? I think that some of appliances can turn on by itself if I set. So , how about computer? If it can , what can I need to do? If not , no problem.
  3. How to screenshot by CMD? I know I can press "win + ps " , but I want to do it by CMD because of the program which can let computer do it by itself. Can I get it?

I'm poor at English , please forgive me if I offend. And thank to everyone first.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

Answer accepted by question author

Joy Qiao 5,812 Reputation points Moderator
2020-12-22T06:13:19.96+00:00

Hi Sun,

Welcome to Microsoft Q&A forum.
This is Joy from Microsoft Device & Deployment support team, I will try to answer your issue about power management.

What's your device model? Is it a virtual machine or physical machine?

I noticed you said powercfg /a show s1,s2,s3 all not available on your deivce. So rundll32.exe powrprof.dll,SetSuspendState 0,1,0 command line not work on your device is an expect behavior as hardware haven't related sleep mode to go into.

I noticed you could "sleep by Win-power-sleep item correctly". Please go to Event Viewer\Windows log\system and check if any event ID 1\42 recorded.
Event ID 42 in the System log from source Kernel-Power is the sleeping event. Event ID 1 in the System log is for waking. We could check event reason for it.

For the second issue, we could configure a wake up scheduler, please refer to How to Make Your PC Wake From Sleep Automatically

For the last issue, we could try Take-Screenshot . As we are not familiar with command line or script, so I would recommend to create a new thread and add tag with "Windows-Server-PowerShell" for consulting command or script issue.

If my information is useful for you, please accept it as answer.

Bests,

============================================

If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Tom Jebo 2,451 Reputation points Microsoft Employee Moderator
    2020-12-19T22:27:17.773+00:00

    Hi,

    The openspec-* tags are dedicated to supporting issues related to open specifications. You can find open specifications here https://learn.microsoft.com/en-us/openspecs/

    Since your question does not pertain to one of these specifications, I've removed the openspecs-windows tag and added the windows-10-general tag. Hopefully this will get your post the proper attention.

    If I've misunderstood your question and you believe this is related to the Open Specifications documents, please clarify, providing the document name and section with which you have the question or issue.

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.