Deleting DLL Files after Execution
Keywords: Deleting dll files after execution cleanup dlls
Question:
When the exe is done executing, at least 2 dlls are left in the same directory as the exe. Is there a way to delete these dlls upon termination. Terminations ends normally every time and if I manually try to delete them before terminating the script I get an error because the dlls are still in use.
Answer:
Add code list this to your script to
write a DOS BAT file to delete the files...
del_files_path = "C:\DELFILES.BAT"
handle = FileOpen(del_files_path, "WRITE")
FileWrite(handle, "@ECHO OFF%@CRLF%REM ******THIS FILE IS SAFE TO DELETE******%@CRLF%%@CRLF%ECHO ON")
FileWrite(handle, ":loop")
FileWrite(handle, "era wbd*34i.dll")
FileWrite(handle, "era wbo*34i.dll")
FileWrite(handle, "if exist wbd*34i.dll goto loop")
FileWrite(handle, "if exist wbo*34i.dll goto loop")
FileWrite(handle, "era ",DEL_FILES_PATH)
FileClose(handle)
Runhide(del_files_path,"")
Exit