Question Access powercfg

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
i can see the open file with the powercfg -requests command in a cmd box, but how do you access the powercfg in vb? its shown as

[DRIVER] \FileSystem\srvnet
An active remote client has files opened on this machine.

My pc just wont goto sleep because there is always a srvnet requests that is keeping it awake

[DRIVER] \FileSystem\srvnet
An active remote client has recently sent requests to this machine.

If i do an override on the srvnet then it will goto sleep even if there is an open file, I am trying to see if i can just override the srvnet and manually have a timer to see if there is an open file and keep the pc awake with the setthreadexcutionstate command
 
Last edited:
If that is what you're trying to do, and you have no open files of concern, then it is my impression that you can call requestsoverride from admin console once and remove this from preventing sleep. Example of commands here:
Windows 7 does not go into standby due to driver \FileSystem\srvnet
It is also possible to call powercfg from a Process when you run your application as admin, but using a script for this should be viable as well.
 
I can override the srvnet and it will sleep, but if i am streaming a video, the server will sleep even when the video is playing. There are 2 events for the srvnet that i am concert about.
An active remote client has files opened on this machine.
An active remote client has recently sent requests to this machine.
The recently sent request one seems to be always there for some reason, it never goes away.
When i override the srvnet, both are ignore, but i only want to ignore the send request one. So i am trying to see if i can read the powercfg request and if i see the opened file message, i can manually prevent sleep after i do the override
 
Back
Top