How disable the checkbox "Allow Computer to Turn Off This Device to Save Power" for a USB device from a cmd command or registry entry

Lucas Mikio Bastos Uyeda 20 Reputation points
2024-10-11T14:15:48.9966667+00:00

I'm generating a .bat script to check some configurations on our desktops for some devices to work better.
I need to disable the checkbox "Allow Computer to Turn Off This Device to Save Power" for a USB device on device manager using this bat.
Is there any way to do that by command prompt (cmd) or registry entry?
User's image

Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,521 Reputation points
    2024-10-12T12:34:00.0333333+00:00

    This .bat worked for me with a given DeviceID :

    @echo off
    REM deviceID="USB\VID_1A40&PID_0101\5&212AC8FC&0&8"
    set deviceID="USB\VID_1A40^&PID_0101\5^&212AC8FC^&0^&8"
    PowerShell -Command "Get-WmiObject -Namespace 'Root\WMI' -Class 'MSPower_DeviceEnable' | Where-Object { $_.InstanceName -like '*%deviceID%*' } | ForEach-Object { $_.Enable = $false; $_.Put() }"
    
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.