Temporarily Disable Screensaver
Moderators: JRL, Dorian (MJT support)
Temporarily Disable Screensaver
I use MSched 5.1.1 (yes, I know its old but has served me well for around 5 years). Recently upgraded my Operating System to WinXP Home. A number of my macros are of the form:
Do This . .
Wait awhile . .
Find open window with text of "XXXX" and press a button to close and continue.
MOST of my macros run at night when I am unable to watch machine.
My problem is that I have a password-protected screensaver on the computer which in prior Windows OSs did not stop the Find a Window command. XP's screensaver is stronger and prevents Msched for finding a window and blows up the macro.
Does anybody know how to programmatically turn a screensaver off and then back on? I think this is the easiest fix. If any alternatives come to mind I would also consider them.
Thanks
Dave
Do This . .
Wait awhile . .
Find open window with text of "XXXX" and press a button to close and continue.
MOST of my macros run at night when I am unable to watch machine.
My problem is that I have a password-protected screensaver on the computer which in prior Windows OSs did not stop the Find a Window command. XP's screensaver is stronger and prevents Msched for finding a window and blows up the macro.
Does anybody know how to programmatically turn a screensaver off and then back on? I think this is the easiest fix. If any alternatives come to mind I would also consider them.
Thanks
Dave
Hi Dave,
as XP is partially based on NT/2000, I expect the Screensaver acts now the way like to lock the box. As I know MSched scripts can't be used like a service, therefore the script execution stops.
Maybe a way is not to (b)lock the box. Change the resolution of your screen (check graphics adapter) and move the window you've to work on outside of the visible part of the screen (which by the way should be switched off in general while you absent to save energy
).
If you show us what you do with the script, we could have a look to find an alternative way to solve the issue ...
Ernest (working with MSched 6.0
)
as XP is partially based on NT/2000, I expect the Screensaver acts now the way like to lock the box. As I know MSched scripts can't be used like a service, therefore the script execution stops.


If you show us what you do with the script, we could have a look to find an alternative way to solve the issue ...
Ernest (working with MSched 6.0

Ernest,
I tested my suggested xe>c:\windows\system32\powercfg.cpl again per your request and confirm the validity of the statement on Windows XP. .CPL (control panel) is a system file and, thus, requires no explicitly declared application to run. I discovered this trick by accident.
As a matter of fact, this script is often used in my apps. For example, Norton Speed Disk for Win98 demands no screensaving; otherwise, it keeps on sorting. Neither do I desire screensaving when I drive my car in the United States with GPS-guided mapping software.
I tested my suggested xe>c:\windows\system32\powercfg.cpl again per your request and confirm the validity of the statement on Windows XP. .CPL (control panel) is a system file and, thus, requires no explicitly declared application to run. I discovered this trick by accident.
As a matter of fact, this script is often used in my apps. For example, Norton Speed Disk for Win98 demands no screensaving; otherwise, it keeps on sorting. Neither do I desire screensaving when I drive my car in the United States with GPS-guided mapping software.
Thanks for all the replies.
First, I tried to use the Execute File approach with desk.cpl which gives me control of the Screensaver applet. I tried to change my screensaver from the existing one to (none). XP blocked the keystrokes and just triggered the "Unlock Computer" password entry box.
I find as I play with this that the issue is not the screensaver per se but that it is a locking Screensaver (I have small kids near my computer during the day so I want the locking feature). If I toggle the Screensaver Apply password field off - all my other macros work fine.
So, re-orienting my thinking - how to change the locking switch. I think that if I run a locking macro in the am and unlocking macro at night (when my unattended processing takes place) I will be fine. The morning locking macro works find:
RegistryWriteKey>HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaverIsSecure,0
Wait>1
ExecuteFile>c:\windows\system32\desk.cpl
Wait>1
WaitWindowOpen>Display*
SetFocus>Display*
Press Ctrl
Wait>.5
Press Tab
Wait>.5
Press Tab
Wait>.5
Release Ctrl
Wait>1
Press Alt
Wait>.5
Send Character/Text>P
Release Alt
Wait>.5
Press Enter
The top RegistryWrite line is designed to place the system in a known status. RegistryWrite in XP writes a field of the type REG_DWORD. The manual use of the screensaver applet writes a registry field of the type REG_SZ. XP interprets a DWORD field (on this line) as a zero value so this returns my system to a known state of password off (value = 0). The manual process of going through desk.cpl then writes a REG_SZ value of 1 to the registry.
I am having a problem on the Unlocking macro. I tried the following:
RegistryReadKey>HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaverIsSecure,SSRStatus
Wait>.5
If>SSRStatus=1,Set0
Goto>ENDPOINT
Label>Set0
RegistryWriteKey>HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaverIsSecure,0
Wait>.5
Label>ENDPOINT
This would write a zero value to the registry (of DWORD form which is okay). However, the machine does not process the macro because the locking screensaver password box pops up and requires user to enter the password. I thought that lock on computer only stopped mouse and keyboard input - it even stops behind the scenes registry writes.
I hope that this extra information helps. Anybody have any ideas?
Thanks
Dave
First, I tried to use the Execute File approach with desk.cpl which gives me control of the Screensaver applet. I tried to change my screensaver from the existing one to (none). XP blocked the keystrokes and just triggered the "Unlock Computer" password entry box.
I find as I play with this that the issue is not the screensaver per se but that it is a locking Screensaver (I have small kids near my computer during the day so I want the locking feature). If I toggle the Screensaver Apply password field off - all my other macros work fine.
So, re-orienting my thinking - how to change the locking switch. I think that if I run a locking macro in the am and unlocking macro at night (when my unattended processing takes place) I will be fine. The morning locking macro works find:
RegistryWriteKey>HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaverIsSecure,0
Wait>1
ExecuteFile>c:\windows\system32\desk.cpl
Wait>1
WaitWindowOpen>Display*
SetFocus>Display*
Press Ctrl
Wait>.5
Press Tab
Wait>.5
Press Tab
Wait>.5
Release Ctrl
Wait>1
Press Alt
Wait>.5
Send Character/Text>P
Release Alt
Wait>.5
Press Enter
The top RegistryWrite line is designed to place the system in a known status. RegistryWrite in XP writes a field of the type REG_DWORD. The manual use of the screensaver applet writes a registry field of the type REG_SZ. XP interprets a DWORD field (on this line) as a zero value so this returns my system to a known state of password off (value = 0). The manual process of going through desk.cpl then writes a REG_SZ value of 1 to the registry.
I am having a problem on the Unlocking macro. I tried the following:
RegistryReadKey>HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaverIsSecure,SSRStatus
Wait>.5
If>SSRStatus=1,Set0
Goto>ENDPOINT
Label>Set0
RegistryWriteKey>HKEY_CURRENT_USER,Control Panel\Desktop,ScreenSaverIsSecure,0
Wait>.5
Label>ENDPOINT
This would write a zero value to the registry (of DWORD form which is okay). However, the machine does not process the macro because the locking screensaver password box pops up and requires user to enter the password. I thought that lock on computer only stopped mouse and keyboard input - it even stops behind the scenes registry writes.
I hope that this extra information helps. Anybody have any ideas?
Thanks
Dave
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Hi dbish,
the case: An application blocked the memory with every session.
The option: I thought about to restart the box to free the memory.
Well I had to deal with a login issue as well!
Requirements:
TweakUI and local Admin rights on the box.
1. Enable "TweakUI/Logon/Logon automatically at system startup"
2. Set User name
3. Set Password
4. "Start/Shut down/Close all programms and logon as a different user"
the logon box appears but an automated login happens. If you would work this way you have to be aware that anyone can login to that box with a simple hardware reset!
As I know the automated TweakUI login is based on a setting at the registry. So it should be possible to set and reset the registry the same way as you're doing it with the screensaver solution.
I thought about this:
shutdown at 4 AM and restart as fully restricted (ChildSave) user: John Dow.
Change registry settings at 9 PM, shutdown and restart as unrestricted (Adult) user: dbish
Ernest
the case: An application blocked the memory with every session.
The option: I thought about to restart the box to free the memory.
Well I had to deal with a login issue as well!
Requirements:
TweakUI and local Admin rights on the box.
1. Enable "TweakUI/Logon/Logon automatically at system startup"
2. Set User name
3. Set Password
4. "Start/Shut down/Close all programms and logon as a different user"
the logon box appears but an automated login happens. If you would work this way you have to be aware that anyone can login to that box with a simple hardware reset!
As I know the automated TweakUI login is based on a setting at the registry. So it should be possible to set and reset the registry the same way as you're doing it with the screensaver solution.
I thought about this:
shutdown at 4 AM and restart as fully restricted (ChildSave) user: John Dow.
Change registry settings at 9 PM, shutdown and restart as unrestricted (Adult) user: dbish
Ernest
Dear Ernest
That approach would work if I knew I would be present at the computer to restart it at each time interval. I leave my computer on all the time and I want to set it up with macros that can be scheduled so that if I am not at the machine some evening my middle of the night macros don't blow up.
Thanks for the thought though.
Dave
That approach would work if I knew I would be present at the computer to restart it at each time interval. I leave my computer on all the time and I want to set it up with macros that can be scheduled so that if I am not at the machine some evening my middle of the night macros don't blow up.
Thanks for the thought though.
Dave
Dave,
I'm sorry (maybe I haven't got it, english isn't my native language so there's always a chance of missunderstanding from my side
).
Another try:
Set the time the script should start in your absence (e.g. 09:00)
Create a batch file which sets the time for a restart at 09:00 - 9.bat
The settings done by this batch file won't allow a restart - NO.bat
Your Msched Script will read that line, compares it with the current time and starts the shutdown and automated restart if matching.
with different batch files (9-,10-,11.bat) and the NO.bat it should be easy to handle.
Rgds,
Ernest
Other options:
Maybe you wanna connect your script to an incoming mail (cause your box is always runing) e.g with a predefined subject: "Start Msched 09:00" so you can start it remotely!
Use a second (download) box without a monitor and connect to it via PCAnywhere or the Terminal Service Client !
I'm sorry (maybe I haven't got it, english isn't my native language so there's always a chance of missunderstanding from my side

Another try:
Set the time the script should start in your absence (e.g. 09:00)
Create a batch file which sets the time for a restart at 09:00 - 9.bat
Code: Select all
echo 09 > C:\ScriptStart.txt
Code: Select all
echo NO > C:\ScriptStart.txt
Code: Select all
ReadLN>C:\ScriptStart.txt,1,line
MidStr>line,1,2,res
If>res=NO, End
Hour>hour
Label>time
If>res=%hour%, Time2Shutdown
Wait>900
Goto>time
Label>Time2Shutdown
...
Rgds,
Ernest
Other options:

Use a second (download) box without a monitor and connect to it via PCAnywhere or the Terminal Service Client !