Jump to content
Sign in to follow this  
testbytest

how can i delete it

Recommended Posts

testbytest

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

Share this post


Link to post
Share on other sites
testbytest

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

Share this post


Link to post
Share on other sites
Jos

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

_SelfDelete($iDelay = 0)

should be:

_SelfDelete()

Because it cannot find $iDelay.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
testbytest

thanks very mush

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  

×