[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

alter wait time w/ batch file ?

Posted on 2001-07-20
9
Medium Priority
?
762 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
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…

649 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