Solved

alter wait time w/ batch file ?

Posted on 2001-07-20
9
741 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you 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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

828 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