Jump to content

multi scrip termination


Recommended Posts

ok guys I have one script called Clean Up.au3 here is the start of it's code

CODE
SoundPlay("C:\WINDOWS\Media\tada.wav")

Sleep(2*1000)

ShellExecute("Timer.au3", "", @ScriptDir, "Run")

Run("C:\Program Files\Windows Defender\MSASCui.exe")

now there is a whole lot more of code but I've left it out, as u can see it executes a second script called timer, timer will count how many hours and min's it takes cleanup to finish it's job.

here is timers code

CODE
ProgressOn("Progress", "", "", 718, 606, 16)

Sleep(2*1000)

$Second = 0

$Min = 0

$Hour = 0

$Pro = 0

Do

ProgressSet($Pro , "", "Count is: "& $Hour &" Hours " & $min &" Mins " & $Second &" Secs")

GuiCtrlCreateProgress(60, 80, 150, 20)

If $Second = 59 Then $Second = -1

If $Second = -1 Then $Min = $Min + 1

If $Min = 60 Then $Min = -1

If $Min = -1 Then $Hour = $Hour + 1

If $Min = -1 Then $Min = $Min + 1

$Second = $Second + 1

$Pro = $Pro + 0.009

Sleep(999.9)

Until (not ProcessExists("Clean Up.au3"))

what's going wrong I think is at the very end of this 2nd script just above, what I want to happen is that when clean up comes to it's end timer will also realise that clean up is done and terminate itself.

but so far clean up turns timer on for about 3 seconds, timer nearly starts counting then goe's nope and terminates, so how do I keep it around until clean up goes then it detects that and shuts itself off?

thanks guys and girls

Link to comment
Share on other sites

I think your problem is with your Timer script.

Last Line:

Until (Not ProcessExists(("Clean Up.au3"))

If you were to open task manager, you would not see a process called "Cleanup.au3" running. Because when you run a non-compiled Autoit Script, it is run through Autoit3.exe

One solution to this is to Compile your "Clean up.au3" script to "Clean up.exe" and the change the last line of timer.au3 to read this:

Until (Not ProcessExists(("Clean Up.exe"))
Link to comment
Share on other sites

thanks, it appears to be working, the timer is counting but I won't know for sure for a few hours until the cleanup script finishes

so scripts can only detect if process's are active? they can't detect other active or inactive scripts?

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...