Go Back   Tech Support Forum > Microsoft Support > Windows 7 , Windows Vista Support

User Tag List

[SOLVED] Command line problem

This is a discussion on [SOLVED] Command line problem within the Windows 7 , Windows Vista Support forums, part of the Tech Support Forum category. Hi, I wanted to be able to induce the screensaver on my monitor when I was finished working. So, I


Closed Thread
 
Thread Tools Search this Thread
Old 06-06-2011, 04:46 AM   #1
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



Hi, I wanted to be able to induce the screensaver on my monitor when I was finished working.

So, I followed the instructions on this link:

How can I turn off the monitor (i.e., "put it to - Microsoft Answers

Quote:
Create a shortcut and enter the following in the Location box.
POWERCFG -Change -monitor-timeout-ac 1
Name the shortcut whatever you wish. Double clicking the shortcut will cause the monitor to sleep in one minute.
You can create another shortcut when you want to use the system for an extended period.
POWERCFG -Change -monitor-timeout-ac 300
This will set the timeout to a 5 hour delay.
EXCEPT that the second part of the instruction doesn't work i.e. the monitor is permanently set to timeout in 1 min.

Obviously, I'm trying to stop this but I can't figure how to turn off this command. When I go to the file location, it just takes me to the C:\Windows\System32 Power Settings Command-Line Tool. Obviously I don't want to delete that but I want to delete the command causing the monitor to turn off in 1 min.
priapus is offline  
Sponsored Links
Advertisement
 
Old 06-06-2011, 07:20 AM   #2
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



I tried that - it didn't work. Like in the thread I posted, the first CMD worked but the longer timeout CMD didn't.
priapus is offline  
Old 06-06-2011, 03:06 PM   #3
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, the powercfg settings are held in the hiberfil.sys file this will recreate a new one (ie you can make all new settings if you wish) Go to start ,all programs, accessories and right click on command prompt select "run as administrator" ( you did do this for the commands didn't you) at the prompt type:-

powercfg -h off (press enter) restart computer

After restart open cmd again (as admin) and type:-

powercfg -h on (press enter)
__________________
jenae is offline  
Sponsored Links
Advertisement
 
Old 06-06-2011, 04:13 PM   #4
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



Quote:
you did do this for the commands didn't you
Errr, no!
priapus is offline  
Old 06-06-2011, 04:28 PM   #5
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



OK, I tried your suggestion but it didn't work. Maybe I need to do it in non-admin mode?
priapus is offline  
Old 06-06-2011, 04:35 PM   #6
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, no command prompt requires you to "run as administrator"... Open a cmd prompt and type:- powercfg/? (press enter) all your options are there.
__________________
jenae is offline  
Old 06-07-2011, 02:54 AM   #7
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



I followed your instructions here:
Quote:
Hi, the powercfg settings are held in the hiberfil.sys file this will recreate a new one (ie you can make all new settings if you wish) Go to start ,all programs, accessories and right click on command prompt select "run as administrator" ( you did do this for the commands didn't you) at the prompt type:-

powercfg -h off (press enter) restart computer

After restart open cmd again (as admin) and type:-

powercfg -h on (press enter)
Anyway, I can see all the options there. ALL I need to know is how to simply delete the one I activated.

The problem is, as I've mentioned, when I enter any other monitor timeout it gets overriden by the 1 min one.
priapus is offline  
Old 06-07-2011, 06:24 AM   #8
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, open a cmd prompt (as administrator) at the prompt type:-

Code:
REG QUERY "HKCU\Control Panel\Powercfg" > %temp%\powercfg.txt & start notepad %temp%\powercfg.txt
Post the notepad outcome here OR if you like locate the timeout setting and modify the value data in that key.
__________________
jenae is offline  
Old 06-07-2011, 07:18 AM   #9
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



OK, here it is:

Quote:
HKEY_CURRENT_USER\Control Panel\Powercfg
CurrentPowerPolicy REG_SZ 0

HKEY_CURRENT_USER\Control Panel\Powercfg\GlobalPowerPolicy
HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies
BTW, thanks for the advice - I guess I shouldn't activate commands without knowing how to undo them. I guess because I saw the thread advice on an MS site I thought it'd be good but apparently not.
priapus is offline  
Old 06-07-2011, 11:06 AM   #10
Administrator
Manager, Microsoft Support
Acting Manager, Security
BSOD Kernel Dump Expert
Microsoft Windows Insider MVP
 
jcgriff2's Avatar
 
Join Date: Sep 2007
Location: New Jersey Shore
Posts: 34,346
OS: Windows 10, 8.1 + Windbg :)



I have the same output here - Windows 7 x64 -
Code:
 HKEY_CURRENT_USER\Control Panel\Powercfg
    CurrentPowerPolicy    REG_SZ    0

HKEY_CURRENT_USER\Control Panel\Powercfg\GlobalPowerPolicy
HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies
Quote:
Originally Posted by priapus View Post
BTW, thanks for the advice - I guess I shouldn't activate commands without knowing how to undo them. ...
Nothing wrong with experimenting at all. I would advise for future registry edits - create a system restore point first, so you can start over, if necessary.

What OS are you running? Under your user name, it says "XP".

Please change profile to reflect current OS - 3rd item down under "Computers Operating System" - https://www.techsupportforum.com/foru...do=editprofile

Thank you.

Regards. . .

jcgriff2

`
jcgriff2 is offline  
Old 06-07-2011, 03:18 PM   #11
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, forgot to expand the tree run cmd again:-(as admin)

Code:
REG QUERY "HKCU\Control Panel\Powercfg" /S > %temp%\powercfg.txt & start notepad %temp%\powercfg.txt
Also go to search and type:- Powercfg.cpl press enter to open your power settings. Your current scheme is checked, select "change plan settings" now we need to select "change advanced power settings" here you have a tree structure look under display or yours may have monitor expand the + and see if you can effect the change here. Be sure to "Apply" and OK out.
__________________
jenae is offline  
Old 06-07-2011, 04:13 PM   #12
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



The 1 min monitor timeout is not shown in the power settings that I can see. It seems to be activating independently.

This is the result of that Reg Query.

Code:
HKEY_CURRENT_USER\Control Panel\Powercfg
    CurrentPowerPolicy    REG_SZ    0

HKEY_CURRENT_USER\Control Panel\Powercfg\GlobalPowerPolicy
    Policies    REG_BINARY    01000000060000000300000010000000060000000300000010000000020000000300000000000000020000000300000000000000020000000100000000000000020000000100000000000000000000000500000000000000000000C00000000005000000000000000A0000000000000003000000010001000100000000000000000000000000000000000000000002000000000000000000000000000000000000000000000003000000000016000000

HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies

HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies\0
    Name    REG_SZ    Home/Office Desk
    Description    REG_SZ    This scheme is suited to most home or desktop computers that are left plugged in all the time.
    Policies    REG_BINARY    01000000020000000100000000000000020000000000000000000000000000002C0100003232000304000000040000000000000000000000B00400002C01000000000000580200000101645064640000

HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies\1
    Name    REG_SZ    Portable/Laptop
    Description    REG_SZ    This scheme is designed for extended battery life for portable computers on the road.
    Policies    REG_BINARY    01000000020000000100000000000000020000000100000000000000B00400002C0100003232030304000000040000000000000000000000840300002C010000080700002C0100000101645064640000

HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies\2
    Name    REG_SZ    Presentation
    Description    REG_SZ    This scheme keeps the monitor on for doing presentations.
    Policies    REG_BINARY    01000000020000000100000000000000020000000100000000000000000000008403000032320302040000000400000000000000000000000000000000000000000000002C0100000101505064640000

HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies\3
    Name    REG_SZ    Always On
    Description    REG_SZ    This scheme keeps the computer running so that it can be accessed from the network.  Use this scheme if you do not have network wakeup hardware.
    Policies    REG_BINARY    0100000002000000010000000000000002000000000000000000000000000000000000003232000004000000040000000000000000000000B00400008403000000000000080700000001646464640000

HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies\4
    Name    REG_SZ    Minimal Power Management
    Description    REG_SZ    This scheme keeps the computer on and optimizes it for high performance.
    Policies    REG_BINARY    01000000020000000100000000000000020000000000000000000000000000002C0100003232030304000000040000000000000000000000840300002C01000000000000840300000001646464640000

HKEY_CURRENT_USER\Control Panel\Powercfg\PowerPolicies\5
    Name    REG_SZ    Max Battery
    Description    REG_SZ    This scheme is extremely aggressive for saving power.
    Policies    REG_BINARY    01000000020000000100000000000000020000000500000000000000B0040000780000003232030204000000040000000000000000000000840300003C00000000000000B40000000101643264640000
priapus is offline  
Old 06-07-2011, 11:54 PM   #13
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, this is interesting maybe (and I haven't been able to find out 300 is outside accepted parameters)

Open cmd prompt as admin and try:-

POWERCFG -Change -monitor-timeout-ac 60

Just been advised to have you run from cmd prompt (admin):-

Code:
powercfg -setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 3600
Press enter, Restart computer (monitor timeout to 60 mins)
__________________
jenae is offline  
Old 06-08-2011, 01:12 AM   #14
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, well even though I appear to be as competent as the keystone cops on this I must admit it is a new area for me (always learning). Seems I am not Robinson Crusoe on this either.

If the previous does not work I think this might, the current power scheme has a reference called a guid if this is corrupt then sfc/scannow might help OR I would delete it and create a whole new plan.. you already have been there powercfg.cpl from search opens it.

Open a CMD as admin and type:-

Code:
powercfg -list > c:\find.txt & start notepad c:\find.txt
press enter

This returns a list of power schemes the "current" active has a * at the end in notepad

This is an example from one of my machines:-
Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 0bad3b32-27d7-429f-9c0c-65a09ef0fe2a (My Custom Plan 1)
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)
Power Scheme GUID: 8f220dce-7909-4a48-afd8-3d6947af2431 (My Custom Plan 2) *
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

The one in red is the one we want to delete:-

Open a cmd prompt and type:- (substitute your guid for the one I example in red)

Powercfg–delete 8f220dce-7909-4a48-afd8-3d6947af2431 (press enter)

Hopefully this will remove the errant monitor setting and allow you to create a new power setting.
__________________
jenae is offline  
Old 06-08-2011, 02:09 PM   #15
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



That's the result of the CMD code you told me to enter.

Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

I haven't tried your suggestion in the reply before the last one.

I should just say that nowhere in the display settings in the control panel does it say that the monitor will turn off in 1 min. Again, it's an override instruction of some sort?
priapus is offline  
Old 06-08-2011, 03:22 PM   #16
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, it looks like the removal of that guid should work as per my post #14. There is another area of the registry. Press the win+r key at the same time and type regedit in the run box, registry editor will open.Navigate to this key.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\{025A5937-A6BE-4686-A844-36FE4BEC8B6D}

Here you will see your "balanced" guid as the plan

381b4222-f694-41f0-9685-ff5bb260df2e

Expand the tree and you will see an entry "Hardware overide" what shows in the right payne against this entry?
__________________
jenae is offline  
Old 06-08-2011, 03:34 PM   #17
Registered Member
 
Join Date: Aug 2009
Posts: 59
OS: Windows 7



Hello,

It says:

Quote:
NAME / TYPE / DATA
[ab](Default) / REG_SZ / POWER OPTIONS
priapus is offline  
Old 06-08-2011, 03:44 PM   #18
Visiting BSOD Expert
Microsoft Support Team
 
Join Date: Aug 2010
Location: New York
Posts: 781
OS: Windows 7 Ultimate x64



@priapus - You can't call like that in Win7 anymore, for a variety of reasons (and you shouldn't be sending this to HWND_BROADCAST anyway, but that's deeper than I think we want to get here). I was going to write up a little app to do this, but it seems someone beat me to it:

Miscellaneous Software

Extract the zip, and you get ScreenSave.exe, which calls this the proper way on Win7 (source included, if you want to look at it). You can simply run screensave.exe /poweroff, and it will turn the monitor off. If you need the machine to lock, set your screensaver to require logon after resume, and instead run screensave.exe /screensave /poweroff.

Also, I think nircmd can do this as well, with some different options.
cluberti is offline  
Old 06-08-2011, 06:34 PM   #19
Moderator
- Microsoft Support
 
jenae's Avatar
 
Join Date: Jun 2008
Location: Sydney
Posts: 7,707
OS: XP, Vista, Seven, & a whole host you would never have heard of.Windows Ten 64 bit Pro



Hi, thanks for joining in Cluberti I am not sure who your remarks are addressed to (I have no idea what they mean) The advice here is sourced from MS and I don't see how screen saver applies maybe it does see MS:-

When you configure power options for the active power plan in Windows Vista or in Windows 7, the changes are not reflected in the Power Options item in Control Panel
__________________
jenae is offline  
Old 06-08-2011, 06:53 PM   #20
Visiting BSOD Expert
Microsoft Support Team
 
Join Date: Aug 2010
Location: New York
Posts: 781
OS: Windows 7 Ultimate x64



Point taken - I've updated my original post to point out that I'm specifically answering the OP's original post directly. Specifically, the function call he makes with the rundll32 command (documented in the link in the first post) won't work in Win7, because (for starters) user32.dll no longer exports the SendMessage API quite the same way - you would have to call SendMessageA or SendMessageW on Windows 7. Also, the first parameter passed is not a good idea (HWND_BROADCAST) for a few reasons, although it would technically work. The program(s) I posted in my post do exactly what the rundll32 command from the original link in the OPs first post would do, hence why that's my "answer" to the OPs original question. Using one of the two programs (I prefer the first) I linked would turn off the monitor and start the screensaver - which is technically almost useless as you're also turning off the display, but it does have the side-effect of locking the system and requiring a password on wake which simply disabling the display would not do, as the rundll32 command would only do.

To answer your question, setting power options isn't going to replicate the rundll32 command the customer originally wanted to use, and seems to me to be the long way around a simple problem (shutting down the display) that can be easily addressed with a few lines of code (or, in this case, already compiled programs).
cluberti is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
DCI/display problem
Hello, I have having problems with my display. I am not quite sure how to describe this problem, or even it if applies to this section of the forum, but I will try my best. :4-dontkno This week (tuesday to be specific), I turned on my computer and discovered that my monitor did not display the...
Windle Video Card Support 4 03-14-2011 08:19 AM
I got a problem when i start some games....black screen appears! with sound
okkk when i run a game....black screen appears..bt i can hear all sounds clearly....and i can also click on button if i move the mouse.... i used to play SPLIT SECOND on the same system..bt now the same game is having this problem... its not just with huge games.... i also had this with an...
headhunter007 PC Gaming Support 4 03-13-2011 11:59 AM
Halo 2 Won't install i hate it...
Hey, I just bought halo 2 at the store and i tought hmm fun game but then when i wanted to install the game it says Microsoft directx has stopped working and then i can't install the game... because i need to close the installation. I already have DX. 11 And got HD Readen 4770, AMD...
Takehofstra Game Installation Support 1 02-26-2011 07:39 PM
Problem Event Name: BlueScreen - BSOD [moved from Vista/ Windows 7]
Thank you in advance for any help you can offer. -Gwen Problem signature: Problem Event Name: BlueScreen OS Version: 6.1.7600.2.0.0.768.3 Locale ID: 1033 Additional information about the problem:
Shoganai BSOD, App Crashes And Hangs 5 02-14-2011 12:09 AM
All games keep crashing randomly!
No mather what game i play on my computer, it crashes from 5 minutes upto an hour into the game. There are no ''warnings'', like lagging or other hiccups before the crash. The screen just freezes, the game closes and return to desktop. (same with all games) Games that have crashed: Fallout...
Bombasa PC Gaming Support 12 01-28-2011 10:57 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 12:36 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts