After searching through this forum I found a nice piece of script which helped us clean up the desktop from errors or other application window which aren't supposed to be there, before we start the next test-cycle.
It worked fine until today when we started to apply this for a new client pc. It seems the script is unable to close it self after there are no more open window. It keeps looping!
Are there anyone out there who use a generic cleanup script we can try?
Here's the script from one of the forum memebers that I use:
; In this case I try to close all open windows on the desktop except QARun + runawl
TopWindowName = Topwindow("ignoretopmost") ;option to ignore the taskbar and report the top-most application window.
IsQARUNEXE = FindStr(TopWindowName, "QARUN.EXE");So we do not close QARun.exe
IsQARUNAWL = FindStr(TopWindowName, "RUNAWL.EXE");So we do not close Runawl.exe
If IsQARUNEXE > 0 OR IsQARUNAWL > 0
QAWindowCounter = 1 + QAWindowCounter
if IsQARUNEXE = 0
LogComment("FoundQARunCount = " + FoundQARunCount)
QAWindowCounter = QAWindowCounter - 1
LogComment("QAWindowCounter = " + QAWindowCounter)
until QAWindowCounter = 2
End Function ;Main
Re: CleanUp Desktop/Window
1. What's different about the machine it doesn't work on?
2. Try running the script in "debug" mode, step by step to see if you can find out why it keeps looping. You may need to add some message boxes for debugging to see the values of the variables.