Jump to content

how can i delete it


Recommended Posts

hi

i use Aut2Exe to create a 1.exe file

how can i use 1.exe to delete 1.exe (delete itself)

and

i must use 1.exe in folder C:\Documents and Settings\All Users\「開始」功能表\程式集\啟動\

(the patch is C:\Documents and Settings\All Users\Start menu\program\start\ in english system)

thanks

Edited by testbytest
Link to comment
Share on other sites

yes i find it before

but i try used it

it return a error message

line:-1

error: Variable used without being declared.

my script is

Run(@ComSpec &" /k dir ")

_SelfDelete($iDelay = 0)

Exit

Func _SelfDelete($iDelay = 0)

Local $sCmdFile

FileDelete(@TempDir & "\scratch.bat")

$sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _

& ':loop' & @CRLF _

& 'del "' & @ScriptFullPath & '"' & @CRLF _

& 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _

& 'del ' & @TempDir & '\scratch.bat'

FileWrite(@TempDir & "\scratch.bat", $sCmdFile)

Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)

EndFunc

Link to comment
Share on other sites

  • Developers

Use au3check to help you with these type of "simple"syntax issues.

_SelfDelete($iDelay = 0)

should be:

_SelfDelete()

Because it cannot find $iDelay.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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