Disable Group Policy Windows 7
To prevent Windows from going into standby / sleep after certain period of inactivity you can use free utility developed by David Anson called Insomnia. You can download from here or from author's MSDN blog.
There is no need to install anything, simply unzip the file and run either 32 or 64 bit version depending on your Operating System. While utility is running computer will not go into sleep mode because of inactivity.
In the right pane, double-click Don't run specified Windows applications. Click Enabled, and then click Show. Click Add, and then type the executable file name of the program that you want to restrict users from running. For example, type iexplore.exe. Click OK, click OK, and then click OK. Quit Group Policy Object Editor, and then click OK. How to disable SMB 1 on Windows 7 via Group Policy to Prevent WannaCry. Update 2: Thanks to fellow Group Policy MVP Norbert Fehlauer for pointing out that you also need to apply the following registry key to disable the SMB 1 protocol on the server aswell. Next you have to also disable the protocol on the SMB 1 Server Service. Here's how: In the Local Group Policy Editor, select the User Configuration Administrative Templates Control Panel branch. Double-click the Show Only Specified Control Panel Items policy. Click the Enabled Option. Click the Show button to open the Show Contents dialog box.
This, however, doesn't prevent computer from going to sleep if user presses sleep button in the start menu or on the keyboard.
To disable sleep mode completely you can use Local Group Policy:
- Launch Local Group Policy Editor (gpedit.msc)
- Navigate to Computer Configuration > Administrative Templates > System > Power Management > Sleep Settings
- Open Policy called Allow Standby States (S1-S3) When Sleeping (Plugged In) and set value do Disabled
- If necessary also do the same for Allow Standby States (S1-S3) When Sleeping (On Battery)
Disable Onedrive Windows 7 Group Policy
Since I needed to enable / disable sleep mode via Group Policy quite often, I created quick and dirty AutoIt script that opens Local Group Policy Editor and navigates to the correct GP:
This policy will disable all sleep modes completely.
To also disable Hibernate mode (standby state S4) run powercfg.exe /hibernate off in an elevated command prompt:
- Start > type Command Prompt > right click on Command Prompt and click Run as Administrator
- Type powercfg.exe /hibernate off and press Enter
Windows 7 Pro
Windows 8 Pro