Sign in to follow this  
Followers 0
Tiger

Problems with Func selfdelete()

3 posts in this topic

The function selfdelete() doesn't working. The function must delete the file "delete.bat", but when I start the function then must delete the file. But the file is always on my pc.


My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites



Seems OK for me. Can you show the test code you are using? The function does delete a scratch.bat.

:whistle:

Share this post


Link to post
Share on other sites

Func _SelfDelete()
    Local $cmdfile
    FileDelete(@TempDir & "\scratch.cmd")
    $cmdfile = ':loop' & @CRLF _
            & 'del "' & @ScriptFullPath & '"' & @CRLF _
            & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
            & 'del ' & @TempDir & '\scratch.cmd'
    FileWrite(@TempDir & "\scratch.cmd", $cmdfile)
    Run(@TempDir & "\scratch.cmd", @TempDir, @SW_HIDE)
EndFunc

This is the function in SciTE


My UDFs:- _RegEnumKey

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