Sign in to follow this  
Followers 0
techshots

Autoit3.exe Process Doesn't Close Out After Completing Script

4 posts in this topic

Hi guys,

I wrote this but after it completes, the autoit3.exe process in task manager remains; you can also see the autioit icon on the bottom right of the system tray.

The plain old "EXIT" didn't work so I added a ProcessClose and that still doesn't work.

------------------------------------- CODE BEGIN -------------------------------------------------------

#include <Process.au3>

#include <Date.au3>

$CurDate = (_Now() )

$DateOnly_from_CurDate = StringLeft($CurDate, 8)

$file = FileOpen("F:\hien\XcopyFav.bat", 1)

; Check if file opened for writing OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

FileWrite($file, "rename favorites" & " " & $DateOnly_from_CurDate & @CRLF)

FileWrite($file, "pause")

FileClose($file)

sleep(5000)

_RunDos("F:\hien\XcopyFav.bat")

If ProcessExists("AutoIt3.exe") Then

ProcessClose("AutoIt3.exe")

Endif

Exit

------------------------------------- CODE BEGIN -------------------------------------------------------

Share this post


Link to post
Share on other sites



I suspect the pause in the batch file is preventing the script reaching the exit command.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Bingo! that's it...thanks so much!

I suspect the pause in the batch file is preventing the script reaching the exit command.

Share this post


Link to post
Share on other sites

Bingo! that's it...thanks so much!

Your welcome.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
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
Sign in to follow this  
Followers 0