Solved

alter wait time w/ batch file ?

Posted on 2001-07-20
9
734 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 48

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 48

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
Being driven mad by email signature updates?

Having to make a change to your users’ email signatures, yet again? Feel like your head is going to explode? Rely on an Exclaimer email signature management solution to make the process simple!

 

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 48

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 48

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
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 viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

920 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

14 Experts available now in Live!

Get 1:1 Help Now