Link to home
Start Free TrialLog in
Avatar of D_baker
D_baker

asked on

Make Monitor Turn off

Hello Experts,

I run a large network and have been asked to make all the monitors turn off after 5 minutes, The computers are all Windows XP SP2.

I thought i could do this by capturing the registry and importing it as a start up script but this failed to work.

Please can someone help.

Regards

DBaker
Avatar of Axter
Axter
Flag of United States of America image

Hi D_baker,
Can you please post your current code?

Cheers!
Avatar of D_baker
D_baker

ASKER

Here is the LOCAL MACHINE REGISTRY:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg]
"LastID"="6"
"DiskSpinDownMax"="3600"
"DiskSpinDownMin"="3"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\GlobalPowerPolicy]
"Policies"=hex:01,00,00,00,01,00,00,00,01,00,00,00,03,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\0]
"Policies"=hex:01,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,07,00,00,00,00,00,04,00,\
  00,c0,00,00,00,00,00,00,00,00,04,00,00,c0,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\1]
"Policies"=hex:01,00,00,00,02,00,00,00,03,00,00,00,03,00,00,00,03,00,00,00,60,\
  09,00,00,2c,01,00,00,80,25,00,00,f4,1a,00,00,32,32,00,00,02,00,00,00,04,00,\
  00,c0,00,00,00,00,02,00,00,00,04,00,00,c0,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\2]
"Policies"=hex:01,00,00,00,02,00,00,00,03,00,00,00,02,00,00,00,02,00,00,00,00,\
  00,00,00,84,03,00,00,00,00,00,00,9c,18,00,00,32,32,00,00,02,00,00,00,04,00,\
  00,c0,00,00,00,00,02,00,00,00,04,00,00,c0,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\3]
"Policies"=hex:01,00,00,00,02,00,00,00,04,00,00,00,02,00,00,00,02,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,5a,5a,00,00,02,00,00,00,04,00,\
  00,c0,00,00,00,00,02,00,00,00,04,00,00,c0,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\4]
"Policies"=hex:01,00,00,00,02,00,00,00,04,00,00,00,02,00,00,00,02,00,00,00,00,\
  00,00,00,08,07,00,00,00,00,00,00,04,29,00,00,5a,5a,00,00,02,00,00,00,04,00,\
  00,c0,00,00,00,00,02,00,00,00,04,00,00,c0,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\5]
"Policies"=hex:01,00,00,00,02,00,00,00,04,00,00,00,03,00,00,00,03,00,00,00,dc,\
  05,00,00,b4,00,00,00,dc,05,00,00,98,0d,00,00,32,0a,00,00,02,00,00,00,04,00,\
  00,c0,00,00,00,00,02,00,00,00,04,00,00,c0,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies\6]
"Policies"=hex:01,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,07,00,00,00,00,00,04,00,\
  00,c0,00,00,00,00,00,00,00,00,04,00,00,c0,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies\0]
"Policies"=hex:01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,a0,\
  86,01,00,a0,86,01,00,a0,86,01,00,28,32,00,00,02,00,00,00,a0,86,01,00,a0,86,\
  01,00,a0,86,01,00,28,3c,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,01,\
  00,28,50,00,00,01,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,\
  a0,86,01,00,a0,86,01,00,a0,86,01,00,0a,14,00,00,02,00,00,00,a0,86,01,00,a0,\
  86,01,00,a0,86,01,00,14,28,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,\
  01,00,14,46,00,00,01,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies\1]
"Policies"=hex:01,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,a0,\
  86,01,00,a0,86,01,00,a0,86,01,00,28,32,00,00,02,00,00,00,a0,86,01,00,a0,86,\
  01,00,a0,86,01,00,28,3c,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,01,\
  00,28,50,00,00,01,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,\
  a0,86,01,00,a0,86,01,00,a0,86,01,00,0a,14,00,00,02,00,00,00,a0,86,01,00,a0,\
  86,01,00,a0,86,01,00,14,28,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,\
  01,00,14,46,00,00,01,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies\2]
"Policies"=hex:01,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,a0,\
  86,01,00,a0,86,01,00,a0,86,01,00,28,32,00,00,02,00,00,00,a0,86,01,00,a0,86,\
  01,00,a0,86,01,00,28,3c,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,01,\
  00,28,50,00,00,01,00,00,00,01,00,00,00,02,00,00,00,00,00,00,00,03,00,00,00,\
  a0,86,01,00,a0,86,01,00,a0,86,01,00,0a,14,00,00,02,00,00,00,a0,86,01,00,a0,\
  86,01,00,a0,86,01,00,14,28,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,\
  01,00,14,46,00,00,01,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies\3]
"Policies"=hex:01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,a0,\
  86,01,00,a0,86,01,00,a0,86,01,00,28,32,00,00,02,00,00,00,a0,86,01,00,a0,86,\
  01,00,a0,86,01,00,28,3c,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,01,\
  00,28,50,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,\
  a0,86,01,00,a0,86,01,00,a0,86,01,00,0a,14,00,00,02,00,00,00,a0,86,01,00,a0,\
  86,01,00,a0,86,01,00,14,28,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,\
  01,00,14,50,00,00,01,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies\4]
"Policies"=hex:01,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,a0,\
  86,01,00,a0,86,01,00,a0,86,01,00,28,32,00,00,02,00,00,00,a0,86,01,00,a0,86,\
  01,00,a0,86,01,00,28,3c,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,01,\
  00,28,50,00,00,01,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,\
  a0,86,01,00,a0,86,01,00,a0,86,01,00,0a,14,00,00,02,00,00,00,a0,86,01,00,a0,\
  86,01,00,a0,86,01,00,14,28,00,00,03,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,\
  01,00,14,46,00,00,01,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies\5]
"Policies"=hex:01,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,03,00,00,00,a0,\
  86,01,00,a0,86,01,00,a0,86,01,00,28,32,00,00,02,00,00,00,a0,86,01,00,a0,86,\
  01,00,a0,86,01,00,28,3c,00,00,02,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,01,\
  00,28,50,00,00,01,00,00,00,01,00,00,00,02,00,00,00,00,00,00,00,03,00,00,00,\
  a0,86,01,00,a0,86,01,00,a0,86,01,00,0a,14,00,00,02,00,00,00,a0,86,01,00,a0,\
  86,01,00,a0,86,01,00,14,28,00,00,02,00,00,00,a0,86,01,00,a0,86,01,00,a0,86,\
  01,00,14,41,00,00,01,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\ProcessorPolicies\6]

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Here is the CURRENT USER REGISTRY

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\PowerCfg]
"CurrentPowerPolicy"="6"

[HKEY_CURRENT_USER\Control Panel\PowerCfg\GlobalPowerPolicy]
"Policies"=hex:01,00,00,00,00,00,00,00,03,00,00,00,10,00,00,00,00,00,00,00,03,\
  00,00,00,10,00,00,00,00,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,03,00,\
  00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,01,00,00,\
  00,00,00,00,00,01,00,00,00,03,00,00,00,00,00,00,00,04,00,00,c0,01,00,00,00,\
  01,00,00,00,01,00,00,00,0a,00,00,00,00,00,00,00,03,00,00,00,01,00,01,00,01,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,\
  00,16,00,00,00

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies]

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\0]
"Name"="Home/Office Desk"
"Description"="This scheme is suited to most home or desktop computers that are left plugged in all the time."
"Policies"=hex:01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,32,32,00,03,01,00,00,00,01,00,\
  00,00,00,00,3d,77,2e,f2,07,00,2c,01,00,00,2c,01,00,00,00,00,00,00,58,02,00,\
  00,01,01,64,64,64,64,91,7c

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\1]
"Name"="Portable/Laptop"
"Description"="This scheme is designed for extended battery life for portable computers on the road."
"Policies"=hex:01,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,01,\
  00,00,00,00,00,00,00,b0,04,00,00,2c,01,00,00,32,32,03,03,04,00,00,00,04,00,\
  00,00,00,00,00,00,00,00,00,00,84,03,00,00,2c,01,00,00,08,07,00,00,2c,01,00,\
  00,01,01,64,50,64,64,00,00

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\2]
"Name"="Presentation"
"Description"="This scheme keeps the monitor on for doing presentations."
"Policies"=hex:01,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,01,\
  00,00,00,00,00,00,00,00,00,00,00,84,03,00,00,32,32,03,02,04,00,00,00,04,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,2c,01,00,\
  00,01,01,50,50,64,64,00,00

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\3]
"Name"="Always On"
"Description"="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"=hex:01,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,32,32,00,00,04,00,00,00,04,00,\
  00,00,00,00,00,00,00,00,00,00,b0,04,00,00,84,03,00,00,00,00,00,00,08,07,00,\
  00,00,01,64,64,64,64,00,00

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\4]
"Name"="Minimal Power Management"
"Description"="This scheme keeps the computer on and optimizes it for high performance."
"Policies"=hex:01,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,2c,01,00,00,32,32,03,03,04,00,00,00,04,00,\
  00,00,00,00,00,00,00,00,00,00,84,03,00,00,2c,01,00,00,00,00,00,00,84,03,00,\
  00,00,01,64,64,64,64,00,00

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\5]
"Name"="Max Battery"
"Description"="This scheme is extremely aggressive for saving power."
"Policies"=hex:01,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,05,\
  00,00,00,00,00,00,00,b0,04,00,00,78,00,00,00,32,32,03,02,04,00,00,00,04,00,\
  00,00,00,00,00,00,00,00,00,00,84,03,00,00,3c,00,00,00,00,00,00,00,b4,00,00,\
  00,01,01,64,32,64,64,00,00

[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\6]
"Policies"=hex:01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,32,32,00,03,01,00,00,00,01,00,\
  00,00,00,00,3d,77,2e,f2,07,00,2c,01,00,00,2c,01,00,00,00,00,00,00,58,02,00,\
  00,01,01,64,64,64,64,91,7c
"Name"="5 Min Monitor"
"Description"=""

>>and importing it as a start up script but this failed to work.

I was really looking for details of your current import method, and how is it failing.

When you say it fails, are you saying the registry fails to get imported, or are you saying the imported data fails to do what you want?
Avatar of D_baker

ASKER

The import is succesfull, however the screens do not turn off. I have also looked at writing something in VB6 but the program needs to stay resident and turn off the monitor after 15 mins of idle time.

EG  Computer turns on>>>>MY PROGRAM LOADS AS SERVICES>>>>15mins Idle>>>>>Turn off monitor>>>>User presses a key to wake up>>>>>>15 mins idle>>>>Turn off Monitor


Is this possible?
You can try using SystemParametersInfo API function.

Example:
SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, ssTimeout, NULL, 0);
FYI:
To shutdown imidiately, you can use the following method:
SendMessage(GetTopWindow(NULL), WM_SYSCOMMAND, (WPARAM)SC_MONITORPOWER, (LPARAM) 2);
ASKER CERTIFIED SOLUTION
Avatar of Axter
Axter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of D_baker

ASKER

Ok so if i want the following to happen how do i do it: -

1. A program to stay in memory and run all the time, whether logged in or logged out (i thought maybe a service)
2. As the program is always loaded, it should look for 15 Mins idle time then turn off monitor
3. Once the user has woken the screen up it should continue to start again.
4. It should not be visable to anyone.

Many Thanks
What's wrong with using the standard XP power-saving control panel to set these parameters?  

Also many computers have this built into the BIOS settings pages.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial