Jump to content
Sign in to follow this  

How to delete temporary files when program is closed

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.


Run ("Laikinas.exe")

if ProcessExists ("Laikinas.exe") then

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

Elseif ProcessExists ("Laikinas.exe") then



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:

Share this post

Link to post
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

; process stopped running.

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

Edited by Manadar

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...