Disable Screen Saver 
Author Message
 Disable Screen Saver

I need scripts that will disable and enable the screen saver.
Here is the code I have tried:

'Modify the Registry to disable Screen Saver
dim strKey, strKeyValue
strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
Set WshShell = WScript.CreateObject("Wscript.Shell")
strKeyValue = WshShell.RegRead(strKey)
WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " & strKeyValue

if strKeyValue = "1" then
    WshShell.Popup "Setting registry value"
    WshShell.RegWrite strKey, "0"
else
end if

.... and here is the code to enable Screen Saver

'Modify the Registry to enable Screen Saver
dim strKey, strKeyValue
strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
Set WshShell = WScript.CreateObject("Wscript.Shell")
strKeyValue = WshShell.RegRead(strKey)
WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " & strKeyValue

if strKeyValue = "0" then
    WshShell.Popup "Setting registry value"
    WshShell.RegWrite strKey, "1"
else
end if

When the above scripts run, the Registry is modified, but the screen saver
operation is not changed.

Microsoft has posted a way to disable screen saver before running Defrag so
I know it can be done but don't know how.

Duane



Wed, 21 Aug 2002 03:00:00 GMT  
 Disable Screen Saver
You have two (maybe more) scenarios you have to think about.

#1. The screen saver is set active and it is already invoked (running).

#2. The screen saver is set active but not yet invoked (not running)

In case #1, until someone jiggles the mouse or some other method that makes
the screen saver wakeup, you new setting will not take effect. When it wakes
up it re-reads the registry! (big hint on how it works!!).

In case #2, It should work as advertised, though if it doesn't then it's a
case of waiting for it to invoke before it re-reads the registry settings,
if this is the case, once it invokes, wake it up again and it will not
invoke again.

Shawn


Quote:
> I need scripts that will disable and enable the screen saver.
> Here is the code I have tried:

> 'Modify the Registry to disable Screen Saver
> dim strKey, strKeyValue
> strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
> Set WshShell = WScript.CreateObject("Wscript.Shell")
> strKeyValue = WshShell.RegRead(strKey)
> WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " & strKeyValue

> if strKeyValue = "1" then
>     WshShell.Popup "Setting registry value"
>     WshShell.RegWrite strKey, "0"
> else
> end if

> .... and here is the code to enable Screen Saver

> 'Modify the Registry to enable Screen Saver
> dim strKey, strKeyValue
> strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
> Set WshShell = WScript.CreateObject("Wscript.Shell")
> strKeyValue = WshShell.RegRead(strKey)
> WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " & strKeyValue

> if strKeyValue = "0" then
>     WshShell.Popup "Setting registry value"
>     WshShell.RegWrite strKey, "1"
> else
> end if

> When the above scripts run, the Registry is modified, but the screen saver
> operation is not changed.

> Microsoft has posted a way to disable screen saver before running Defrag
so
> I know it can be done but don't know how.

> Duane



Fri, 23 Aug 2002 03:00:00 GMT  
 Disable Screen Saver
You say "Microsoft has posted a way to disable screen saver before running
Defrag ". Can you give more details please.

I have a couple of scripts that I am testing at the moment. One to Toggle
the ScreenSaver on and off. The other to check if the ScreenSaver is active
and if so deactivate it before running Defrag after which it restores the
previous setting. The problem I haven't resolved is clearing and restoring
any password in the process. I can alter the Registry value but with a
password set Defrag continues with the ScreenSaver still displaying.

--
Steve Whitnear
Please do not email.  Reply in newsgroup


Quote:
> I need scripts that will disable and enable the screen saver.
> Here is the code I have tried:

> 'Modify the Registry to disable Screen Saver
> dim strKey, strKeyValue
> strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
> Set WshShell = WScript.CreateObject("Wscript.Shell")
> strKeyValue = WshShell.RegRead(strKey)
> WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " & strKeyValue

> if strKeyValue = "1" then
>     WshShell.Popup "Setting registry value"
>     WshShell.RegWrite strKey, "0"
> else
> end if

> .... and here is the code to enable Screen Saver

> 'Modify the Registry to enable Screen Saver
> dim strKey, strKeyValue
> strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
> Set WshShell = WScript.CreateObject("Wscript.Shell")
> strKeyValue = WshShell.RegRead(strKey)
> WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " & strKeyValue

> if strKeyValue = "0" then
>     WshShell.Popup "Setting registry value"
>     WshShell.RegWrite strKey, "1"
> else
> end if

> When the above scripts run, the Registry is modified, but the screen saver
> operation is not changed.

> Microsoft has posted a way to disable screen saver before running Defrag
so
> I know it can be done but don't know how.

> Duane



Sat, 24 Aug 2002 03:00:00 GMT  
 Disable Screen Saver
I don't know if it's what you want speak about, but perhaps this registry
value can help you :

Key :
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Defrag\S
ettings\
String : DisableScreenSaver
Data : yes

Jean



Sat, 24 Aug 2002 03:00:00 GMT  
 Disable Screen Saver
Here is the link to the Microsoft solution for Disabling Screen Saver During
Defrag.exe
I have implemented this and it does work.

http://support.microsoft.com/support/kb/articles/Q229/0/57.ASP?LNG=EN...
LKB&FR=0

What I want to do is run a backup with the Task Scheduler at night and I
would like to schedule a script that will disable the Screen Saver (Since I
know it is a resource hog) during the backup.   Then at a later time after
backup completes I will have another script scheduled to turn the screen
saver back on.  I will be using Veritas Backup Version 4.2 configured to
backup to a file over the network.

This is for a small office that has 4 PC's with peer to peer networking.
Each PC has an 8 GB drive partitioned into two 4 GB partitions.   I am
backing up each PC to one of the other PC's on the second partition.

Future plans are for a 40 GB drive in a removable mount that will be used
for backup files of all 4 systems.   Two drives will provide for offsite
backup with the drives being exchanged each week before the scheduled
backup.

Duane


Quote:
> You say "Microsoft has posted a way to disable screen saver before running
> Defrag ". Can you give more details please.

> I have a couple of scripts that I am testing at the moment. One to Toggle
> the ScreenSaver on and off. The other to check if the ScreenSaver is
active
> and if so deactivate it before running Defrag after which it restores the
> previous setting. The problem I haven't resolved is clearing and restoring
> any password in the process. I can alter the Registry value but with a
> password set Defrag continues with the ScreenSaver still displaying.

> --
> Steve Whitnear
> Please do not email.  Reply in newsgroup



> > I need scripts that will disable and enable the screen saver.
> > Here is the code I have tried:

> > 'Modify the Registry to disable Screen Saver
> > dim strKey, strKeyValue
> > strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
> > Set WshShell = WScript.CreateObject("Wscript.Shell")
> > strKeyValue = WshShell.RegRead(strKey)
> > WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " &
strKeyValue

> > if strKeyValue = "1" then
> >     WshShell.Popup "Setting registry value"
> >     WshShell.RegWrite strKey, "0"
> > else
> > end if

> > .... and here is the code to enable Screen Saver

> > 'Modify the Registry to enable Screen Saver
> > dim strKey, strKeyValue
> > strKey = "HKCU\CONTROL PANEL\Desktop\ScreenSaveActive"
> > Set WshShell = WScript.CreateObject("Wscript.Shell")
> > strKeyValue = WshShell.RegRead(strKey)
> > WshShell.Popup "Reading Registry Value" & vbCrLf & "Value; " &
strKeyValue

> > if strKeyValue = "0" then
> >     WshShell.Popup "Setting registry value"
> >     WshShell.RegWrite strKey, "1"
> > else
> > end if

> > When the above scripts run, the Registry is modified, but the screen
saver
> > operation is not changed.

> > Microsoft has posted a way to disable screen saver before running Defrag
> so
> > I know it can be done but don't know how.

> > Duane



Sat, 24 Aug 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. disable screen saver

2. Screen Saver Disable

3. Screen Saver Disable

4. How to make a shortcut (VBS/JS WSH) to en- and disable screen saver?

5. Screen saver

6. Suppress Screen Saver

7. Screen Saver

8. Screen-Saver ---> EPS

9. WSH script to toggle screen saver on/off.

10. turn on/off screen saver?

11. Help Re: Screen Saver Code

12. screen saver password control

 

 
Powered by phpBB® Forum Software