Is this possible with a script/macro?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ScriptNoob
Newbie
Posts: 3
Joined: Mon Jul 24, 2006 5:15 pm

Is this possible with a script/macro?

Post by ScriptNoob » Mon Jul 24, 2006 5:22 pm

Hi,

Before I buy this software there's something I want to know: I want my computer to wake up from hibernation in the middle of the night and run a series of programs for me: virus check => spyware check => defrag => backup. After this I want it to go back into hibernation. Is it possible to do this with a script/macro?

Thanks

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jul 24, 2006 5:30 pm

Unfortunately when the PC is in hibernation the processor isn't running. Therefore applications aren't technically running. Therefore it is not possible for software to wake up the PC - since that software isn't being processed! The only way to wake up a PC from hibernation is via a hardware interrupt. In short only hardware can wake the PC up.

Of course, if it's just the monitor that is hibernating then all is fine. To allow Macro Scheduler to schedule and run the tasks at night the machine will need to be running properly. You could use a screen saver or lock the machine (and use AutoLogon) but if it is fully hibernated the task won't run. Having said that all PCs are different, so you could try it, but I wouldn't expect it to work.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Jul 24, 2006 6:39 pm

FWIW I was looking into something similar a while ago and it appears that some BIOS's do support a timed wake up from hibernation. There is a shareware app nnchron that can apparently do this trick:

http://www.nncron.ru/help/EN/working/pl ... up.spf.htm

This does seem somewhat unlikely, and I have never tried it, but it could be worth looking into since I doubt that Macro Scheduler by itself can do this.

ScriptNoob
Newbie
Posts: 3
Joined: Mon Jul 24, 2006 5:15 pm

Post by ScriptNoob » Mon Jul 24, 2006 9:36 pm

Ik know that windows task scheduler can wake up the computer from hibernation: http://techrepublic.com.com/5100-10877_11-6073491.html#

If I produce a script/macro (maybe compile it into an exe) and schedule it as a task, it should wake up the computer from hibernation.

I've been looking into just using windows task scheduler and let the computer switch into hibernation mode off and on; creating a new task for each program, estimating the time each program will use. This however seems impractical to me; I want to schedule a script that runs the programs in a consecutive order; after a program has finished the other program should start immediately. Is it feasible with this software? If I create a macro, should I keep recording all the way through the scan until it finishes, to record the finishing mouse clicks?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jul 24, 2006 9:46 pm

You can tell Macro Scheduler to wait until a specific wndow opens/closed.

If you are recording, then you may want to wait for the full scan and then remove the WAIT and used WaitWindowOpen or WaitWindowClosed to continue.

Or you can set the scan to just do one small folder while you record the macro. After the macro is recorded, change the scanning specs to the real folders that you want done.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jul 24, 2006 9:50 pm

If you just want to run a sequence of programs and wait for each one to finish before running the next then just use Run Program with RP_WAIT=1:

RP_WAIT=1
Run Program>program1.exe
Run Program>program2.exe
Run Program>program3.exe

Setting RP_WAIT to 1 causes the script to wait until the program started with the Run Program command has fully terminated before continuing.

If you are waiting for some change in the GUI then there are lots of ways to do that such as WaitWindowOpen, WaitWindowChanged, WaitPixelColor, Image Recognition, etc etc
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Jul 24, 2006 9:54 pm

Another way to handle the consecutive order issue is to record separate scripts for each task, then write a master script that runs each of the small scripts. The next script can't start until the previous script has completed.

The master script would look something like this

Macro>c:\path\directory\script1.scp
Macro>c:\path\directory\script2.scp
Macro>c:\path\directory\script3.scp

Hope this is helpful,
Dick

ScriptNoob
Newbie
Posts: 3
Joined: Mon Jul 24, 2006 5:15 pm

Post by ScriptNoob » Tue Jul 25, 2006 1:53 pm

Thanks for the replies...my question has been answered.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts