Use a winbatch script as a screensaver

Started by jfrasier, December 30, 2013, 02:13:45 PM

Previous topic - Next topic

jfrasier

Basically after a certain amount of time has passed without mousemoves or keystrokes, I want the application to close and then reopen. I thought maybe writing a script, compiling it and then renaming it with a .scr extension might work. It does sort of. Here are the lines of code:

currentwin = WinGetActive()
WinClose(currentwin)
timedelay(3)
Run("C:\Program Files\Google\Chrome\Application\chrome.exe","")

It closes Chrome fine, but it doesn't open it back up. Actually I think it does for a split second and then closes it again.

Any ideas? Thanks

Jane

jfrasier

If I just run it as an .exe it does start the program.

snowsnowsnow

I'm guessing the problem is that when the screensaver is active, the "normal" desktop is not connected, so your WinClose won't work.

You probably have to "unscreensaver" it (I think this is possible, I just forget how to do it ATM), then do your WinClose.

jfrasier

It does close the window. What it doesn't do is Run Chrome.

Deana

Deana F.
Technical Support
Wilson WindowWare Inc.