S and S Posted April 7, 2023 Share Posted April 7, 2023 Features: Automatically shut off the console after a N-Minutes of inactivity. It will listen for any Keyboard or Controller input. Once activity is found, the app is paused of N-minutes. Here's a gotcha, though. Windows requires permission to run the shutdown command. If you're running as admin, I think you're fine. If not you'll need to give your user permission... Open the Local Security Policy editor by typing "secpol.msc" in the Start menu search box and pressing Enter. In the Local Security Policy editor, navigate to Local Policies > User Rights Assignment. In the right-hand pane, double-click the "Shut down the system" policy. In the "Shut down the system Properties" window, click the "Add User or Group" button. In the "Select Users or Groups" dialog box, type your user name in the "Enter the object names to select" field and click "Check Names" to confirm the user name. Click OK to close the "Select Users or Groups" dialog box, and then click OK to close the "Shut down the system Properties" window. Close the Local Security Policy editor. Attached is the C++ Code and the compiled code. Usage: `AutoSleep.exe <minutesAllowedInactive> <pauseMinutesBetweenActivity>` Example usage: `AutoSleep.exe 120 45` Everything should work out of the box, but I'm not normally writing C++ Code... or working within Windows for that matter. I welcome any changes or updates. I am placing this in beta and keeping it there. AutoSleep.exe autosleep.cpp 1 Quote Link to comment Share on other sites More sharing options...
Fursphere Posted July 28, 2023 Share Posted July 28, 2023 Does it work in Windows 10 too? Or Windows 11 only? Quote Link to comment Share on other sites More sharing options...
ShelbyHughes Posted September 13, 2023 Share Posted September 13, 2023 (edited) Just a quick tip, to give Windows permission to run the shutdown command, you can follow these steps:1. Press the win key on your keyboard. 2. Type "secpol.msc" in the search box and hit Enter. 3. In the Local Security Policy editor, go to Local Policies > User Rights Assignment. 4. Double-click the "Shut down the system" policy in the right-hand pane. 5. Click the "Add User or Group" button. 6. Type your username in the field and click "Check Names" to confirm. 7. Click OK to close the dialog boxes and close the editor. Hope this still helps someone here, guys. Sometimes, getting a new windows key may be helpful too. Edited September 13, 2023 by ShelbyHughes 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.