gertsolo Posted September 10, 2009 Share Posted September 10, 2009 (edited) Hey, I have a remote PC which I use as server for my media files. When I don't use it I want it to go to standby after, for example, one hour. When I want to use it I wake it up on Lan. When I use the default windows power settings it works fine from time to time, but not always. Is there a better AutotIt alternative for monitoring a windows system and letting it go to standby when there is no activity? thx Edited September 10, 2009 by gertsolo The more you learn, the less you know. Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 10, 2009 Share Posted September 10, 2009 It depends on how well you define "idle". If you are only looking at no mouse and no keyboard use, that's easy enough. This CodeProject article has code for a dll that will let you check the ticks (a unit of time) that the user has not moved the mouse or touched the keyboard. Link to comment Share on other sites More sharing options...
99ojo Posted September 10, 2009 Share Posted September 10, 2009 It depends on how well you define "idle". If you are only looking at no mouse and no keyboard use, that's easy enough. This CodeProject article has code for a dll that will let you check the ticks (a unit of time) that the user has not moved the mouse or touched the keyboard.Hi,have a look at the _Net* functions. You may loop and check if files are open. In the loop you have a sleep (60000)If no Files are open count up an counter and shutdown server if counter = 60If files are open reset counter.;-))Stefan Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 10, 2009 Share Posted September 10, 2009 Looking at the files won't be very good because Windows will hold some files of it's own. Link to comment Share on other sites More sharing options...
gertsolo Posted September 12, 2009 Author Share Posted September 12, 2009 It depends on how well you define "idle". If you are only looking at no mouse and no keyboard use, that's easy enough. This CodeProject article has code for a dll that will let you check the ticks (a unit of time) that the user has not moved the mouse or touched the keyboard.I use is as remote server, so there is no mouse/keyboard activity. I want it to go to sleep when no other computers or media servers are connecting to it. The more you learn, the less you know. Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 13, 2009 Share Posted September 13, 2009 (edited) Then you might want to look at the command "net session" in Windows. I don't know for sure how it works, but I believe it will tell you (via the console) about any connections to the computer. net session Is literally what you would type into the prompt. I don't know if that was clear enough. Edited September 13, 2009 by Richard Robertson Link to comment Share on other sites More sharing options...
gertsolo Posted September 14, 2009 Author Share Posted September 14, 2009 (edited) Then you might want to look at the command "net session" in Windows. I don't know for sure how it works, but I believe it will tell you (via the console) about any connections to the computer.net sessionIs literally what you would type into the prompt. I don't know if that was clear enough.Yup, it is clear enough. I already told me that there are no active connections, so there is something else that keeps it awake.thx Edited September 14, 2009 by gertsolo The more you learn, the less you know. Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 14, 2009 Share Posted September 14, 2009 You could make an AutoIt script that reads the output from net session every once in a while (every 5 minutes maybe) and if it says no sessions, then call Shutdown(32). That's standby. Would that work? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now