Sign in to follow this  
Followers 0
XTensionX

permanent delete

19 posts in this topic

#1 ·  Posted (edited)

hi

i how can i delete a file complete.. not moving it to the recycle bin but permanently delete it?

i know about filedelete and filerecycle

but is there a code to delete it permanantly?

thanks

Edited by XTensionX

Share this post


Link to post
Share on other sites



hi

i how can i delete a file complete.. not moving it to the recycle bin but permanently delete it?

i know about filedelete and filerecycle

but is there a code to delete it permanantly?

thanks

What are the functions filedelete and filerecycle doing in your oppinion?

Jos


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

Share this post


Link to post
Share on other sites

What are the functions filedelete and filerecycle doing in your oppinion?

Jos

That looks like a trick question. Can I have some time to think about it?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Is he talking about deleting it then writing over it multiple times so theres no way that it can be retreived? Thats all I can think of if filedelete and filerecycle aren't good enough for him.

Edited by Hawkwing

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

FileDelete() deletes the file permanantly as far as I know. >_

Share this post


Link to post
Share on other sites

Yes, but deleting a file only erases the fact that it is there. Unless it is overwritten you can still retrieve it with the right software, but I don't know why filedelete wouldn't suffice for anyone unless they are doing something malicious.


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites

...but I don't know why filedelete wouldn't suffice for anyone unless they are doing something malicious.

Well that's just baloney. A lot of people don't want private data easily retrievable by someone that logs onto their computer (consider laptops, lost thumbdrives etc)

XTensionX, try the Eraser UDF

Share this post


Link to post
Share on other sites

oh thanks for the comment guys..

i guess filedelete is the only option.. ty

im trying to make my program delete itself at a certain time.. and not being able to retrieve it back

not quite sure how i should do this though.. i'll find a way >_<

Share this post


Link to post
Share on other sites

Search Example Scripts. It's been done before.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Search Example Scripts. It's been done before.

You know, I'm tired of people telling newbs this. Have you tried searching, yourself? The results suck nowadays. There was a FAQ which had the answer right on it - but then, it only deleted the script from a batch file - it didn't erase the contents. Why not go a step further and provide a GOOD answer. seriously..

*edit: the original FAQ contents (which have been mostly obliterated) can be found in the 'Web Archive', I just posted this on the FAQ -> here <-

Edited by Ascend4nt

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

You know, I'm tired of people telling newbs this. Have you tried searching, yourself? The results suck nowadays. There was a FAQ which had the answer right on it - but then, it only deleted the script from a batch file - it didn't erase the contents. Why not go a step further and provide a GOOD answer. seriously..

Get tired of it all you want. The fact is that I don't have the time to go looking for it myself right now but I do remember that it was posted. If you care to take the time to do the search or write the code for them you are certainly free to do so. If you don't get people putting some effort into finding the answers for themselves then they won't figure out how to work through the forums. On the other hand, if you want to write everybody's code for them, the rest of us can reply with "try this and if that doesn't work just wait a while and Ascend4nt will be along to do it for you."

Edit: Oh, I forgot the part where I'm not sure from the OP's one reply that this is for a legitimate purpose either. It may be but on the other hand...

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Get tired of it all you want. The fact is that I don't have the time to go looking for it myself right now but I do remember that it was posted. If you care to take the time to do the search or write the code for them you are certainly free to do so. If you don't get people putting some effort into finding the answers for themselves then they won't figure out how to work through the forums.

Right- 'I don't have the time to go looking for it myself' is a lame excuse for your post. If you're going to put a post in the HELP forum, why not be um.. helpful?. The 'search for it' response is too easy and all it does is add to your overall post count rather than actually help someone.

Share this post


Link to post
Share on other sites

Right- 'I don't have the time to go looking for it myself' is a lame excuse for your post. If you're going to put a post in the HELP forum, why not be um.. helpful?. The 'search for it' response is too easy and all it does is add to your overall post count rather than actually help someone.

I stopped looking at my post count several years ago and I could care less what the count is. Now get youself back to working out this persons problem for him and get off my back.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

@GEOSoft, right. Leave the helping to those of us who know how.

XTensionX, that Eraser UDF I mentioned is one way to get rid of files - but for self-erasing a script, you might try downloading the portable version of Eraser -> here<-, that is if you have a place to put those files where someone won't find it. You can use the batch-file erase described in the FAQ, but I'd adjust things this way:

1. from the portable version of the Eraser program, keep only the eraserl.exe and eraser.dll files in your script folder (or install it into the @TempDir (and adjust the below code as needed)

2. Add this to your script (I haven't tested it btw - too afraid too haha

Func _SelfDelete($iDelay = 0)
    Local $sCmdFile
    FileDelete(@TempDir & "\scratch.bat")
    $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF & _
            ':loop' & @CRLF & _
            'eraserl -silent -file "' & @ScriptFullPath & '"' & @CRLF & _
            'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF & _
            'del "'&@ScriptDir& '\eraser.dll"' & @CRLF & _
            'del "'&@ScriptDir& '\eraserl.exe"' & @CRLF & _
            'del "' & @TempDir & '\scratch.bat"'
    FileWrite(@TempDir & "\scratch.bat", $sCmdFile)
    Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)
EndFunc

*edit: fixed '&' in wrong place, also fixed surrounding quotes

Edited by Ascend4nt

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Compare the join dates sonny. Geo has no problem knowing how, and he's 100% correct. If you've been here a while you get to notice the same old questions. Hence why we tell people to search.

Oh... and hes got one of those little badges...

Edited by BrettF

Share this post


Link to post
Share on other sites

@BrettF:

Dude, he did NOT help, that's the point. he posted a pointless post. WTH is he doing in the Help forum if he's not HELPING?! And if you say 'do the search' then you should do it yourself first before making yourself look like an idiot.

It's like this:

billy: Gramps, where can I get my shoe repaired?

Gramps: Billy, I remember the days when there were shoe repair shops, and people who did it on the street even! I dunno, you could probably still find someone around..

billy: *frowns*

Dad: Billy, here I know of a place. (gives billy advice)

Now who's 'Gramps' and who's 'Dad' in that conversation. Take a guess.

btw, who cares about MVP badge? Does that make my point invalid?

And the remark I made about the post count was not that he was TRYING to increase it, its just that is all he basically did.

And now you've added more useless stuff to this post. Seriously.. this is just ridiculous.

Share this post


Link to post
Share on other sites

And another pointless post from you.

Right. Because I made no valid points in my post (more like you chose to ignore them). I think my message was clear enough.

I do find it funny though how two MVP's come to post here (one pointing out the MVP status badge), yet neither has anything valuable to add. But thanks for showing up! XTensionX would surely be grateful if he hadn't/hasn't already lost interest. I hope he saw my help in between the arguing.

Share this post


Link to post
Share on other sites

@GEOSoft, right. Leave the helping to those of us who know how.

XTensionX, that Eraser UDF I mentioned is one way to get rid of files - but for self-erasing a script, you might try downloading the portable version of Eraser -> here<-, that is if you have a place to put those files where someone won't find it. You can use the batch-file erase described in the FAQ, but I'd adjust things this way:

1. from the portable version of the Eraser program, keep only the eraserl.exe and eraser.dll files in your script folder (or install it into the @TempDir (and adjust the below code as needed)

2. Add this to your script (I haven't tested it btw - too afraid too haha

Func _SelfDelete($iDelay = 0)
    Local $sCmdFile
    FileDelete(@TempDir & "\scratch.bat")
    $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF & _
            ':loop' & @CRLF & _
            'eraserl -silent -file "' & @ScriptFullPath & '"' & @CRLF & _
            'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF & _
            'del "'&@ScriptDir& '\eraser.dll"' & @CRLF & _
            'del "'&@ScriptDir& '\eraserl.exe"' & @CRLF & _
            'del "' & @TempDir & '\scratch.bat"'
    FileWrite(@TempDir & "\scratch.bat", $sCmdFile)
    Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE)
EndFunc

*edit: fixed '&' in wrong place, also fixed surrounding quotes

thanks Ascend4nt..

and btw people i actually try searching for what i am looking for from the help, internet,search etc.. before i start posting a new thread on the forum..

the only time when i post a thread on the forum is when i couldnt find an answer to what i am looking for myself.

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