Script to disable "turn off this device to save power" for NIC Power Management (VBScript)  

Introduction 

This VBS Script illustrates how to disable "turn off this device to save power" feature in Power Management. 

Scenarios 

Many users want to disable the option in network device called: Allow the computer turn off this device to save power. Now, this script can help users to disable "turn off this device to save power" feature in Power Management of all physical network adapters. 

Script 

Step1: Run this script. It will show the following figure.

Step2: Then click “Yes” button and it will reboot .After that ,you will find "turn off this device to save power" is disabled. 

Before execute the script 

After execute the script 

Here are some code snippets for your references. To get the complete script sample, please click the download button at the beginning of this page.

VB Script
Edit|Remove
If  Err = 0ThenIf value = 24Then'Verify if the model is enable 
        wscript.echo  "The 'Allow the computer to turn off this device to save power' has been disabled."Else 
        objShell.RegWrite Path, 24"REG_DWORD"'Modify the key ,and disable the modelIf Err = 0Then  
            intAnswer = _ 
                 wscript.echo ("The 'Allow the computer to turn off this device to save power' has been disabled. It will take effect after reboot, do you want to reboot right now?", _ 
                 vbYesNo, "Reboot right now") 
            If intAnswer = vbYes Then 
                objShell.Run "C:\WINDOWS\system32\shutdown.exe -r -t 0"EndIfElse  
            wscript.echo  "Operation failed.Ensure that you have the administrator permission"EndIfEndIfElse  
    wscript.echo  "Operation failed.Ensure that you have the administrator permission"EndIf

Prerequisite

Windows 7 or higher version  

Additional Resources 

Related forum threads: 

http://social.technet.microsoft.com/Forums/en-US/windowsserver2008r2networking/thread/eb42064a-8ee2-4a63-867b-4ab416684c8e
http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/thread/89a2797e-0c6e-4e53-b9dd-cb7f2fca5c65
http://us.generation-nt.com/pnpcapabilities-powermanagement-windows-7-help-199014021.html