Solved

alter wait time w/ batch file ?

Posted on 2001-07-20
9
751 Views
Last Modified: 2013-12-29
Hi,
I would like to write a batch file that would change the wait time for the win95 screensaver to a specified length, for example 5 minutes. I am assuming it will need to modify the HKEY_CURRENT_USER/ControlPanel/desktop/ScreenSaveTimeOut value in the registry, but I'm not sure how to alter it. Any ideas???

Thanks...
0
Comment
Question by:frenomulax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 49

Expert Comment

by:dbrunton
ID: 6304404
No, not necessary.  You can use a scripting language to pass the parameters into the display properties.  The one I use is WinCmd available as a free download from

http://www.zdnet.com/pcmag/stories/downloads/0,9063,2350366,00.html

Use a batch file to call the scripting language.  You will have to step through the sequence of instructions you need to feed into the script language.

Have fun.
0
 

Expert Comment

by:EpsyIon
ID: 6304841
Comment deleted.

ComTech
Community Support Mdoerator
0
 
LVL 49

Expert Comment

by:dbrunton
ID: 6307414
Here is what you want in the WinCmd script language and a batch file to run WinCmd.  This sets the delay to 12 seconds in the screensaver page.

This is file test.bat

wincmd saver.wcm

This is file saver.wcm

"rundll32.exe shell32.dll,Control_RunDLL desk.cpl,@0,1"
delay(200)
sendkeys("%w12")
rem sendkeys("%w5")
rem sendkeys("2")
sendkeys("{enter}")
rem sendkeys("{enter}")
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 3

Expert Comment

by:Bruce_R
ID: 6309240
regedit.exe will accept a filename as a parameter.
if you copy the following

REGEDIT4

[HKEY_CURRENT_USER\Control Panel\desktop]
"ScreenSaveTimeOut"="300"

and make it a text file, you can change the number to whatever you want in seconds. Call it something like timeout.reg. Then all you need is the line

regedit timeout.reg

in you batch file.

0
 

Author Comment

by:frenomulax
ID: 6310840
Bruce_R,
your solution does most of what I want, in fact even easier as I intended to run this from an desctop icon anyway. I can just run the .reg file instead of using the batch file to call it. One problem though, even though I can see the value change in regedit, it does not take effect until I refresh the desktop. I know of three ways to do this:
1 - click the desktop and press F5
2 - Ctl-Alt-Del > Choose Explorer > End Task > No to "Shut Down?" > End Task
3 - Start > Shut Down > Close all & log on as new user

Of these only the 3rd actually changes the wait time value in the Desktop > Properties GUI. Problem is that this is more of a hassle than getting to the Desktop > Properties GUI, which is what I want to avoid.

So, is there a way to refresh the desktop from the command line that I can call from the .bat wrapper? Maybe a way to use rundll32.exe? If so, that should do exactly what I want.


dbrunton,
I have downloaded winCmd but not yet had a change to check it out in any depth. Do you think using the solution you have here will avoid the issue of refreshing the desktop? I don't yet understand the details of your script, so any explanation would be welcome.

Thanks
0
 

Author Comment

by:frenomulax
ID: 6310951
Bruce_R,
your solution does most of what I want, in fact even easier as I intended to run this from an desctop icon anyway. I can just run the .reg file instead of using the batch file to call it. One problem though, even though I can see the value change in regedit, it does not take effect until I refresh the desktop. I know of three ways to do this:
1 - click the desktop and press F5
2 - Ctl-Alt-Del > Choose Explorer > End Task > No to "Shut Down?" > End Task
3 - Start > Shut Down > Close all & log on as new user

Of these only the 3rd actually changes the wait time value in the Desktop > Properties GUI. Problem is that this is more of a hassle than getting to the Desktop > Properties GUI, which is what I want to avoid.

So, is there a way to refresh the desktop from the command line that I can call from the .bat wrapper? Maybe a way to use rundll32.exe? If so, that should do exactly what I want.


dbrunton,
I have downloaded winCmd but not yet had a change to check it out in any depth. Do you think using the solution you have here will avoid the issue of refreshing the desktop? I don't yet understand the details of your script, so any explanation would be welcome.

Thanks
0
 
LVL 49

Accepted Solution

by:
dbrunton earned 100 total points
ID: 6311322
No, there's no difficulty in refreshing the desktop with my solution.

There are two files with my code.  The first is the batch file that runs the WinCmd application.  That is the line

wincmd saver.wcm

where saver.wcm is the file that wincmd gets its instructions from.

In the file saver.wcm ignore the lines that have rem in front of them.  The line

"rundll32.exe shell32.dll,Control_RunDLL desk.cpl,@0,1"

opens up the Display properties to the screensaver page

delay(200)

This gives a delay of 200 microsecs (or something similar)

sendkeys("%w12")
sendkeys("{enter}")

These two lines send keys to the screensaver page.  These are

ALT-W
12
and the Enter key to close the screensaver page.  The 12 is the time involved.
0
 

Author Comment

by:frenomulax
ID: 6315819
dbrunton,
That works great, and wincmd looks really interesting. I need to spend some time checking it out. Actually, I seem to remember someone here pointing it out to me once. One last question, is there any way to minimize or hide the Screen Saver Properties dialog that pops up? Even if not, this is good.
Thanks.
0
 
LVL 49

Expert Comment

by:dbrunton
ID: 6319549
Probably not in this box.  They don't have a minimise function.  Try removing the delay.  That might do it.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring Remote Assistance for use with SCCM
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question