Solved

alter wait time w/ batch file ?

Posted on 2001-07-20
9
729 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
9 Comments
 
LVL 47

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 47

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
 
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
Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 

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 47

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 47

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

Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

Join & Write a Comment

Suggested Solutions

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now