XTensionX Posted August 2, 2009 Share Posted August 2, 2009 (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 August 2, 2009 by XTensionX Link to comment Share on other sites More sharing options...
Developers Jos Posted August 2, 2009 Developers Share Posted August 2, 2009 hii how can i delete a file complete.. not moving it to the recycle bin but permanently delete it?i know about filedelete and filerecyclebut is there a code to delete it permanantly?thanksWhat are the functions filedelete and filerecycle doing in your oppinion?Jos 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 More sharing options...
GEOSoft Posted August 2, 2009 Share Posted August 2, 2009 What are the functions filedelete and filerecycle doing in your oppinion?JosThat 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!" Link to comment Share on other sites More sharing options...
Hawkwing Posted August 2, 2009 Share Posted August 2, 2009 (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 August 2, 2009 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. Link to comment Share on other sites More sharing options...
Info Posted August 2, 2009 Share Posted August 2, 2009 FileDelete() deletes the file permanantly as far as I know. >_ Link to comment Share on other sites More sharing options...
Hawkwing Posted August 2, 2009 Share Posted August 2, 2009 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. Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 2, 2009 Share Posted August 2, 2009 ...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 My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
XTensionX Posted August 2, 2009 Author Share Posted August 2, 2009 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 >_< Link to comment Share on other sites More sharing options...
GEOSoft Posted August 3, 2009 Share Posted August 3, 2009 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!" Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 3, 2009 Share Posted August 3, 2009 (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 August 3, 2009 by Ascend4nt My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
GEOSoft Posted August 3, 2009 Share Posted August 3, 2009 (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 August 3, 2009 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!" Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 3, 2009 Share Posted August 3, 2009 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. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
GEOSoft Posted August 3, 2009 Share Posted August 3, 2009 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!" Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 3, 2009 Share Posted August 3, 2009 (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 hahaFunc _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 August 3, 2009 by Ascend4nt My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
BrettF Posted August 3, 2009 Share Posted August 3, 2009 (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 August 3, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 3, 2009 Share Posted August 3, 2009 @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. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
BrettF Posted August 3, 2009 Share Posted August 3, 2009 And another pointless post from you. Take a break for a while >_ Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 3, 2009 Share Posted August 3, 2009 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. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
XTensionX Posted August 3, 2009 Author Share Posted August 3, 2009 @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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now