Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Windows 7 I can use the parameter getactivescheme to get this information. How can I get it on Windows 2003?

On Windows 7 I can run the following code:

PS C:\Users\e> powercfg -getactivescheme
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)

On Windows 2003, I get an error:

PS G:\> powercfg -getactivescheme
Invalid Parameters -- try "/?" for help
PS G:\>

Anyone can help? Thanks.

share|improve this question

migrated from stackoverflow.com Jan 22 '13 at 22:08

This question came from our site for professional and enthusiast programmers.

    
Belongs on SuperUser –  Jim Deville Jan 22 '13 at 17:39
    
See here: ss64.com/nt/powercfg-xp.html –  David Ruhmann Jan 22 '13 at 18:51
add comment

1 Answer 1

up vote 2 down vote accepted

This is a quote from Microsoft

/query, /q
Use the following command to query each scheme to find out the settings: powercfg /query scheme For example, if you run powercfg /query "always on", the settings for the Always On scheme appear. [...]

If you do not specify a particular scheme, the default scheme settings appear. For example, if you run powercfg /query, the settings of the current scheme appear. The current scheme is listed in the Power Options tool in Control Panel.

In Windows 7 Powercfg -query displays the name and GUID of your active scheme in the first line. Maybe the strategie for Windows 2003 would be similar. The following example shows you how to extract the scheme name with windows batch commands. Of course you can convert this example to powershell.

@echo off
powercfg -query > list.txt
set /p line=< list.txt  
for /F "tokens=2 delims=()" %%a in ("%line%") do set string=%%a
echo %string%
del list.txt
pause 

How it works

  • Pipe the output of powercfg -query to a temp text file
  • Read back only the first line of the temp file
  • strip out everything between ( and )
  • display the scheme name with echo
  • delete the temp file
share|improve this answer
    
Yes it does not work. It just shows some of the configurations of the active scheme, but no scheme name. –  Yousui Jan 23 '13 at 2:35
    
PS G:\> powercfg /query Field Description Value ----------------- ----- Name Always On Numerical ID 3 Turn off monitor (AC) Not Supported Turn off monitor (DC) Not Supported Turn off hard disks (AC) Not Supported Turn off hard disks (DC) Not Supported System standby (AC) Not Supported System standby (DC) Not Supported System hibernates (AC) Not Supported System hibernates (DC) Not Supported Processor Throttle (AC) Not Supported Processor Throttle (DC) Not Supported PS G:\> –  Yousui Jan 23 '13 at 2:36
    
In Windows 2003 it seems that it is the 4th line which contain the scheme name. In Windows 7 it is the first line. You have to customize the example. –  nixda Jan 23 '13 at 9:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.