Sign in to follow this  
Followers 0
lapcia

How to delete temporary files when program is closed

2 posts in this topic

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:

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

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