Jump to content

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


Recommended Posts

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

Link to comment
Share on other sites

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


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

Link to comment
Share on other sites

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

Your welcome.


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

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