Jump to content

Script stops


Recommended Posts

I think that he must be simple but

script stops in line 19, can somebody help me

AutoItSetOption ("TrayIconDebug", 1)

Run             (@ScriptFullPath & '\..\Prog\acad.exe')
WinWait("AutoCAD 2006", "")

;~ Espera até ao proximo passo
While WinExists("AutoCAD 2006", "")
   Sleep(100)
WEnd

;- Termina os processos que ficaram pendentes
While 1
    If ProcessExists('AdskScSrv.exe') Then
        ProcessClose('AdskScSrv.exe')
    ElseIf ProcessExists('AdsKCleanup.0001') Then 
        ProcessClose('AdsKCleanup.0001')
    ElseIf ProcessExists('WSCommCntr1.exe') Then 
        ProcessClose('WSCommCntr1.exe')
    ElseIf ProcessExists('acad.exe') Then  ;- Line 19
        ProcessClose('acad.exe')
    EndIf
WEnd

Exit

thanks

Link to comment
Share on other sites

While 1

If ProcessExists('AdskScSrv.exe') Then

ProcessClose('AdskScSrv.exe')

ElseIf ProcessExists('AdsKCleanup.0001') Then

ProcessClose('AdsKCleanup.0001')

ElseIf ProcessExists('WSCommCntr1.exe') Then

ProcessClose('WSCommCntr1.exe')

ElseIf ProcessExists('acad.exe') Then ;- Line 19

ProcessClose('acad.exe')

EndIf

WEnd

This While WEnd loop never ends. If every process is closed the loop goes into overdrive and makes ur CPU mad.

Try something like this just above the WEnd: Sleep(500)

This should be much better. This doesn't end your loop, so the program still tries to close the processes indefinetly.

Greetz,

Tri

Edit: typo

Edited by Triblade

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...