Jump to content

Self Delete During Running


tempman
 Share

Recommended Posts

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

Link to comment
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.
Link to comment
Share on other sites

  • 1 year later...
  • Moderators

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)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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

Link to comment
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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...