Jump to content

How to delete temporary files when program is closed


 Share

Recommended Posts

Hi everyone :lmao:

I have one simple for you but still hard question for me:

I made an exe which runs certain program, but i have difficulties to delete temporary files which are created when program is exited.

Program:

Run ("Laikinas.exe")

if ProcessExists ("Laikinas.exe") then

MsgBox(0,"DEMESIO", "Programa veikia")

Elseif ProcessExists ("Laikinas.exe") then

MsgBox(0,"DEMESIO", " ISVALYTAS")

EndIf

I've tried to make cycle which checks if the program is running and if it's not executes file deleting.

Thank you in advance for your time. :ph34r:

Link to comment
Share on other sites

If you are not doing anything while the program is active. Perform a RunWait command in stead of a normal Run. Otherwise, do this:

$PID = Run();fill in parameters!

While ProcessExists($PID)
    ;do stuff
Wend

; process stopped running.

DirRemove() can delete a directory. So find out where the temporary files are 'hiding' and delete the directory.

Edited by Manadar
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...