System file checker

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Robbyn
Junior Coder
Posts: 43
Joined: Tue Feb 15, 2005 9:55 pm

System file checker

Post by Robbyn » Tue Nov 14, 2006 2:34 pm

SFC has a problem in that it does not remember that the system cd is in the CD tray and keeps asking for it to be put there or Hit retry. Retry works until the next file it wants to confirm. This macro is intended to hit Retry every time the error window arises.

label>start
WaitWindowOpen>Windows file protection
press alt
send>R
release alt
goto>start

Windows file protection is the name of two windows that open when SFC is run. One is the main window showing the progress of the scan and the other the error message. How do I distinguish between the two windows? I want alt R to only apply to the error window.

Also how do I stop MacroS from freezing because the above loop has been operated too many times. Above a number of iterations MS seems to freeze.


Robin

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

Post by JRL » Tue Nov 14, 2006 2:43 pm

First thing I'd try is set WF_TYPE to 3

Let>WF_TYPE=3
label>start
WaitWindowOpen>Windows file protection
press alt
send>R
release alt
goto>start

As for MS freezing after certain a number of iterations... I don't know what number that would be. I have computers that have been running for months with multiple scripts looping continuously every 100th of a second and they have never had a problem.

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

Post by Marcus Tettmar » Tue Nov 14, 2006 2:46 pm

Try adding a short delay inside the loop:

Wait>0.2
Goto>start
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Robbyn
Junior Coder
Posts: 43
Joined: Tue Feb 15, 2005 9:55 pm

Post by Robbyn » Tue Nov 14, 2006 4:48 pm

I changed the default data directory to my documents:

F:\My Documents\MacroSchedulerMacros

When I look for the macro I created I can find it in Explorer but not in MSch. What should I do to find it in MSch
Robin

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

Post by Marcus Tettmar » Tue Nov 14, 2006 4:49 pm

I'm guessing you changed the folder externally (outside of Macro Scheduler)?

Anyway, you will now need to import the macro. File/Import or File/New/Import.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Robbyn
Junior Coder
Posts: 43
Joined: Tue Feb 15, 2005 9:55 pm

Post by Robbyn » Tue Nov 14, 2006 7:06 pm

The macro worked but not well. The program sent an ALT R to both windows, irrespective.
Robin

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 » Tue Nov 14, 2006 8:29 pm

Need to add SetFocus before doing Alt/Send commands ?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Nov 14, 2006 9:25 pm

Hi Robbyn,

Did you try Let>WF_TYPE=3 ?

If that didn't help, both windows have the same title so SetFocus may not help.

FindWindowWithText may be able to differentiate between the two windows if there is some text that always appears on one of them but not the other.

And as Help for FindWindowWithText says... "If the WIN_USEHANDLE variable is set to 1 result_variable will contain the window's handle" so you might use this to capture the handles of the two windows. Once you have the handles, you can run other commands that specify that handle and know which window you are targeting.

If none of that works, there are image recognition techniques. Look for recent posts here on this. You'd be looking to match a portion of the error window that is different from the other window but always the same for any error that might pop up.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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