Sign in to follow this  
Followers 0
tempman

Self Delete During Running

7 posts in this topic

Well this is an example how app can delete itself during running :mellow:

dummy.au3

FileInstall("del.bat", "del.bat")
Run("del.bat", "", @SW_HIDE)
MsgBox(4096,"Task", "Just keeping task alive...")

del.bat

TASKKILL /IM "dummy.exe"
PING 1.1.1.1 -n 5 -w 1000 >NUL
del dummy.exe
del del.bat
exit

I hope this could help someone. :P

Share this post


Link to post
Share on other sites



Maybe this?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Hey that is really neat... but you should have warned me there is a 15 second delay between the time the program runs and the time it deletes itself... but it really works great... Thanks...

Share this post


Link to post
Share on other sites

I always preferred to wait until reboot to delete the file, letting Windows clean it up with other temp files. I usually use something like this:

#include <APIConstants.au3>
#include <WinAPIEx.au3>
_WinAPI_MoveFileEx(@ScriptFullPath, "", $MOVE_FILE_DELAY_UNTIL_REBOOT)

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I always preferred to wait until reboot to delete the file, letting Windows clean it up with other temp files. I usually use something like this:

#include <APIConstants.au3>
#include <WinAPIEx.au3>
_WinAPI_MoveFileEx(@ScriptFullPath, "", $MOVE_FILE_DELAY_UNTIL_REBOOT)

That method has several downsides, first one would be the need for administrator privileges. Second one is reboot itself - for example, I don't remember when I did that last time on my home PC. I think it was three, four months ago when I installed VS. Before that it was something like two months, when I got this machine and installed windows.

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

That method has several downsides, first one would be the need for administrator privileges. Second one is reboot itself - for example, I don't remember when I did that last time on my home PC. I think it was three, four months ago when I installed VS. Before that it was something like two months, when I got this machine and installed windows.

That means you give a shit about MS patches - tough...

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

That method has several downsides, first one would be the need for administrator privileges. Second one is reboot itself - for example, I don't remember when I did that last time on my home PC. I think it was three, four months ago when I installed VS. Before that it was something like two months, when I got this machine and installed windows.

You make an excellent point, of course. For most of what I do for customers, I am delivering a package of software through a third party tool, such as SCCM, Altiris, etc. As it typically runs as SYSTEM, or at least under an administrative account, I didn't think about that limitation.


√-1 2^3 ∑ π, and it was delicious!

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