[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

GPO Setting/Script to enable USB keyboard/mice to wake computer from standby

Posted on 2011-03-22
8
Medium Priority
?
1,786 Views
Last Modified: 2012-05-11
I am trying to find some information on how to set any USB mouse and keyboard to "Allow device to wake computer from standby."

I search EE and found most questions/answers were from 2009 or before.  This is 2011- there has got to be a way to get this to work without having to physically touch each machine.  I used procmon to find the registry entry for a few keyboards and a few mice, but every device has a different registry entry.

Only found XP to not have these checked by default.  On Windows 7 every USB HID device I tried on multiple workstations had this enabled by default.


Any help is much appreciated.
0
Comment
Question by:lulz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 10

Expert Comment

by:pjasnos
ID: 35190745
Just to be more precise - are you trying to enable this setting on Win XP, or disable it on Win 7?
0
 
LVL 10

Assisted Solution

by:pjasnos
pjasnos earned 1000 total points
ID: 35190847
and, have you considered using this:

http://support.microsoft.com/kb/915160

Powercfg has option -deviceenablewake:
http://technet.microsoft.com/en-us/library/cc748940%28WS.10%29.aspx

You can use powercfg to list devices supporting this and then parse the output looking for devices having keyboard or mouse in their name using command line utility findstr.

There should soon be someone here who would put my algorithm above into a ready script for you - if there's no one willing to do it, I'll make and post one in the next few days.
0
 

Author Comment

by:lulz
ID: 35191344
I need it enabled on every WinXP machine.  We are moving to Win7, but the request was made to enable it on all existing WinXP machines.

We initially made a powercfg bat file that just loops through every device that is capable of waking the machine and enables it.  It just seems sloppy to do it that way.  A script that could detect mice/keyboards and enable would be preferred.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Assisted Solution

by:pjasnos
pjasnos earned 1000 total points
ID: 35193361
You can use findstr, or GNU awk for parsing device names and thus detecting most of the mice/keyboards.
0
 

Author Comment

by:lulz
ID: 35210223
I started making a batch file (see below) but it doesn't store information into the text file correctly.  When I type the command in the prompt it works, but in the batch it doesn't.  Also don't know how to pull the information out of the file and enable the devices line by line until EOF.

I'm grasping at straws to get this running.  VBScript is still preferred but I'm very unfamiliar in it.


powercfg -DEVICEQUERY wake_programmable > C:\%COMPUTERNAME%.txt
findstr /i "mouse" C:\%COMPUTERNAME%.txt > C:\%COMPUTERNAME%_PWR.txt
findstr /i "keyboard" C:\%COMPUTERNAME%.txt >> C:\%COMPUTERNAME%_PWR.txt

powercfg -DEVICEENABLEWAKE ???

Open in new window

0
 

Author Comment

by:lulz
ID: 35218889
Latest solution that works, but doesn't record results correctly in the log file.  Any assistance with this?

@ECHO OFF

(
echo keyboard
echo mouse
) > "C:\devices.txt"

if exist "%temp%\results.log" del "%temp%\results.log"

for /F "delims=" %%f in ('powercfg.exe /DEVICEQUERY wake_programmable ^| findstr /g:"C:\devices.txt" /i ') do ( powercfg.exe /DEVICEENABLEWAKE "%%f" >> "%temp%\results.log" )

if exist C:\devices.txt del C:\devices.txt

Open in new window

0
 

Accepted Solution

by:
lulz earned 0 total points
ID: 35256430
We are currently testing the solution in a small test bed.  We eliminated the log file sections of the script.


@ECHO OFF

(
echo keyboard
echo mouse
) > "%temp%\devices.txt"

for /F "delims=" %%f in ('powercfg.exe /DEVICEQUERY wake_programmable ^| findstr /g:"%temp%\devices.txt" /i ') do ( powercfg.exe /DEVICEENABLEWAKE "%%f" )

if exist "%temp%\devices.txt" del "%temp%\devices.txt"

Open in new window

0
 

Author Closing Comment

by:lulz
ID: 35312548
The solution will enable any attached mouse or keyboard to wake a computer from standby.  This script can be set as a login script.
0

Featured Post

Sign your company up to try the MB 660 headset now

Take control and stay focused in noisy open office environments with the MB 660. By reducing background noise, you can revitalize your office and improve concentration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question