Sign in to follow this  
Followers 0
Zedna

FileWipe - very fast (using memory mapped files + memset)

25 posts in this topic

#1 ·  Posted (edited)

This function rewrite whole content of given file by defined (implicitly 0x0) character and finally delete it, it's called as secure deleting.

This should be VERY fast!!

Just note that there is no error checking inside FileWipe()

Maybe I will post later also version with error checking.

You can comment line FileDelete($sFileName) to see how it's rewritten before deletion.

EDIT: There can be problems with too big files (>2GB or > amount of RAM) see post #8 by Kafu

#include <WinAPI.au3>

; prepare testing file
FileDelete('1.txt')
FileWrite('1.txt','123abc')

FileWipe('1.txt')

Func FileWipe($sFileName, $nByte = 0x0)
    If Not FileExists($sFileName) Then Return
    $iSize = FileGetSize($sFileName)
    $hFile = _WinAPI_CreateFile($sFileName, 2, 6)
    $hMapping = _WinAPI_CreateFileMapping($hFile)
    $pAddress = _WinAPI_MapViewOfFile($hMapping)
    MemSet($pAddress, $nByte, $iSize)
    _WinAPI_UnmapViewOfFile($pAddress)
    _WinAPI_CloseHandle($hMapping)
    _WinAPI_CloseHandle($hFile)
     FileDelete($sFileName)
EndFunc

Func MemSet($pDest, $nChar, $nCount)
    DllCall("msvcrt.dll", "ptr:cdecl", "memset", "ptr", $pDest, "int", $nChar, "int", $nCount)
    If @error Then Return SetError(1,0,False)
    Return True
EndFunc

; from WinAPIEx - just simplified for this purpose

Func _WinAPI_CreateFileMapping($hFile)
    Local $Ret = DllCall('kernel32.dll', 'ptr', 'CreateFileMappingW', 'ptr', $hFile, 'ptr', 0, 'dword', 0x4, 'dword', 0, 'dword', 0, 'ptr', 0)
    If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0)
    Return $Ret[0]
EndFunc

Func _WinAPI_MapViewOfFile($hMapping)
    Local $Ret = DllCall('kernel32.dll', 'ptr', 'MapViewOfFile', 'ptr', $hMapping, 'dword', 0x6, 'dword', 0, 'dword', 0, 'dword', 0)
    If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0)
    Return $Ret[0]
EndFunc

Func _WinAPI_UnmapViewOfFile($pAddress)
    DllCall('kernel32.dll', 'int', 'UnmapViewOfFile', 'ptr', $pAddress)
    If @error Then Return SetError(1, 0, 0)
    Return 1
EndFunc

Here is my first test version without memory mapped files:

Func FileWipe($sFileName, $nByte = 0x0)
    If Not FileExists($sFileName) Then Return
    $iSize = FileGetSize($sFileName)
    $tBuffer = DLLStructCreate("byte[" & $iSize & "]")
    MemSet(DLLStructGetPtr($tBuffer), $nByte, $iSize)
    $hFile = _WinAPI_CreateFile($sFileName, 2, 6)
    _WinAPI_WriteFile($hFile, DLLStructGetPtr($tBuffer), $iSize, $iSize)
    _WinAPI_CloseHandle($hFile)
    FileDelete($sFileName)
EndFunc
Edited by Zedna

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I could swear I read somewhere that overwriting a file with Null characters does absolutely nothing, but I can't find anything to support that statement. I did find this though. http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=29245

1) absolut nonsense :-)

There are several wipe methods, some of them rewrite file several times with different and/or random data, this my method is basic one.

You can easily accomodate it to your needs.

2) your link is obsolete, http://www.planetsourcecode.com/vb/scrip...ts/ShowCode.asp?txtCodeId=2924 --> anyway this code does nothing as I see in first quick look

Please post only if you know something about it. Thanks.

EDIT:

some links

http://en.wikipedia.org/wiki/Data_remanence

http://en.wikipedia.org/wiki/Data_erasure

Edited by Zedna

Share this post


Link to post
Share on other sites

nice!! i search for secure deleting method but i didn't find it in Autoit.. Thanks for Zedna . so, file will be null before deleting and we can't recover this file again, right??


[font=verdana,geneva,sans-serif]I will do my best in this forum [/font][font=verdana,geneva,sans-serif]my code :[/font] WindowsSwitcher3d()

Share this post


Link to post
Share on other sites

? ... Skeptic here! ... Its this code writing faster to disk than AutoIt itself will do?

(That is at least what it sounds like to me.)


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hello,

thanks for you code, very useful.

In the code without mapped files, there is a little mistake in the code :

$hFile = _WinAPI_CreateFile($sFileName, 2, 6)

What do you think about my code :

Func _FileWipeSecure($sFileName, $times = 4)
  Local $iSize, $tBuffer, $hFile   
  Local $nByte[3] = [1,0x0,0x1]
  if $times < 1 then $times = 1
  If Not FileExists($sFileName) Then SetError(1,0,0)
    $iSize = FileGetSize($sFileName)
    $tBuffer = DLLStructCreate("byte[" & $iSize & "]")
For $i = 1 to $times
  MemSet(DLLStructGetPtr($tBuffer), $nByte[$nByte[0]], $iSize)
  $hFile = _WinAPI_CreateFile($sFileName, 2, 6)
  _WinAPI_WriteFile($hFile, DLLStructGetPtr($tBuffer), $iSize, $iSize)
  _WinAPI_CloseHandle($hFile)
  if $nByte[0] = 1 Then
   $nByte[0] += 1
  Else
   $nByte[0] = 1
  Endif
Next
    Return FileDelete($sFileName)
EndFunc
Edited by ricky03

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@ricky03

Thanks for correction in variable name, fixed.

I don't like multiple overwriting, so I didn't do that. Anyway feel free to make it in your modifications.

I think memory mapped files will be much faster, maybe I will do some test scripts later.

Edited by Zedna

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hi Zedna,

I really like this one ;), but some points came to my mind. Better use _Winapi_FileGetSizeEx to pass the 2 GB limit. Also I would recommend to process larger files in a loop, as the files are mapped to the process address space and thus large files are likly to consume too much RAM (up to crashing the script). My post on " should contain all required details for that.

Regards

Edited by KaFu

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Other version. (although for all I know it might actually NOT overwrite the original file data. ... Disk cluster and such.)

Func WipeFile_Zeros($sFilespec)
    If FileExists($sFilespec) Then
        Local Const $FILE_EREASE = 2
        Local Const $FILE_BEGIN = 0 ;; <constants.au3>
        Local $iLenght = FileGetSize($sFilespec)
        Local $hFile = FileOpen($sFilespec, $FILE_EREASE) ;; Binary(+16) don't seems to matter.)
        FileSetPos($hFile, $iLenght - 1, $FILE_BEGIN)
        FileWrite($hFile, Chr(0))
        FileClose($hFile)
    EndIf
EndFunc

Err ... think I just got scooped.

Whats wrong with this code. ? (... fixed)

---

Note to self: forum (update) message might be a little older than you think.</constants.au3>

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#10 ·  Posted

(although for all I know it might actually NOT overwrite the original file data. ... Disk cluster and such.)

After a little testing. This seems to be exactly the case. ('seems': as in, although the test I did is leaving little room for any other conclusion, its also not 100% foolproof. And to boot its was only done on one windows version.)

... Bummer! ...


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#13 ·  Posted

I wasn't going to pipe in, but here's my older implementation:

I have a bunch of unpublished updates that use the work I did with the windows defrag api that can be used to really test this. That code can pull raw data directly from the disk sectors to verify overwriting of the file. I also use some neat tricks with the defrag api to overwrite EFS encrypted and OS compressed and sparse files. The thing with those is using CreateFile or mapped files does not overwrite the physical disk where the files actually reside. The new data is simply written somewhere else and the old data marked deallocated and lost to posterity.

At some point soon I hope to finalize what I've done and post an update. I really had meant to go through the SDelete source code to compare to my implementation... maybe I'll get to that as well.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I'll pop these in here for now for some preliminary review. There's still some debugging code in them, and the free space wipe is mostly untested - it's the main reason I wanted to review the SDelete source code. But it works, so any feedback is appreciated. If you have questions on usage, let me know. Check the utility functions in the _FileMapping UDF for functions to print the file map and read it back to a file - used to extract files directly from disk both before and after wiping for verification purposes (you'll need a hex editor for after ;) ).

Using the _FileMapping functions on compressed and EFS encrypted files is actually pretty neat, as you get to see the actual stored compressed/encrypted content which is usually transparent to the user.

_SecureFileDelete.au3

_FileMapping.au3

_FileEx.au3

Edited by wraithdu

Share this post


Link to post
Share on other sites

Hi Zedna,

Is this FileWipe function accept wildcard like *.txt for a paramter?

If no, is there any similiar function that accept wildcard as a paramter?

Thanks :-)

Share this post


Link to post
Share on other sites

Hi Zedna,

Is this FileWipe function accept wildcard like *.txt for a paramter?

If no, is there any similiar function that accept wildcard as a paramter?

Thanks :-)

Looking at the code I would say no, but why not try it first before asking.

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Looking at the code I would say no, but why not try it first before asking.

You're right, sorry, my bad :( thanks for remind :)

Share this post


Link to post
Share on other sites

Is there a way to get this to write files over 2gb or ram?

My understanding is that any time you "map" the file, the whole file goes into memory, so any file over the maximum ram size would cause an error?

Is there a way to add data without loading the already existing content into memory?

I think this would be a great utility to use as a disk cleaner (map over all "free" space with empty bytes to perm. erase data)

If there is not a way, I suppose I could use a loop to make multiple 2gb files and delete them, but I think that may take longer.

Share this post


Link to post
Share on other sites

I think this would be a great utility to use as a disk cleaner (map over all "free" space with empty bytes to perm. erase data)

http://www.dban.org/

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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

  • Similar Content

    • rudi
      By rudi
      Hello.
      I'm too stupid to see my mistake:
      To investigate the internal "dictionary" of TIFF files I'd like to read in the files in binary mode and to check, if there are more than one pages "in" this TIFF.
      Notepad++, "View as Hex" is presenting the first bytes as "49 49 2a 20 08 20 20 20 12" for the TIF attached to this posting
      The "TIFF Header Format" is easy:
      Offset 00h, 2 Byte = Byte Order, "II"=intel, "MM"=motorola. (I = 0x49)
      --> II
      Offset 02h, 2 Byte = Version Nr.
      Offset 04h, 4 Byte = pointer to first IFD entry
      Description of TIFF header: https://www.awaresystems.be/imaging/tiff/faq.html#q3
       

      Howto read and analyse the binary content correctly? This is my messy, not operational code:
       
      $sampleTiff="H:\daten\tif\11\11\111111.TIF" $h=FileOpen($sampleTiff,16) $content=FileRead($h) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console FileClose($h) $type=VarGetType($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $type = ' & $type & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $ToString=BinaryToString($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ToString = ' & $ToString & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & @CRLF) $content=StringTrimLeft($content,2) ; cut off the leading "0x" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console for $i = 1 to 8 step 8 $next=StringMid($content,$i,2) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $next = ' & $next & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $Chr=BinaryToString($next) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Chr = ' & $Chr & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & "---" & @CRLF) Next Regards, Rudi.
      111111.TIF
    • usmiv4o
      By usmiv4o
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.4.3 Author: usmiv4o Script Function: AutoIt script to check if files in directory are changed. It is usefull for security contra-inteligense measures. Function Name: LoadTripwireDB() Description: Loads database (text file tripwire.txt) and compare files in /test folder for changes. compares Hash (MD5) checksums. If they are not the same starts Initial() Function Name: Initial() Description: Checks directory and makes index of files and their MD5 checksums in text file (tripwire.txt) Function Name: Hush() Description: Checks file and returns its MD5 checksum. Requirement(s): Windows XP Return Value(s): On Success - Returns true. Files are the same as before. On Failure - return false. Example: LoadTripwireDB() #ce ---------------------------------------------------------------------------- #include <Crypt.au3> #include <File.au3> #include <Array.au3> $sDir = @ScriptDir & "\Test" $sFilePath = @ScriptDir & "\tripwire.txt" Func Hush(ByRef $sFile) $sRead = FileOpen( $sFile) $dHash = _Crypt_HashData($sRead, $CALG_MD5) ; Create a hash of the text entered. ConsoleWrite("Hash of file " & $sFile & " is " & $dHash & @CRLF) EndFunc ;ConsoleWrite("Files in Dir are " & $aScriptDir[0] & @CRLF) ;$sFilePath = @ScriptDir & "\Examples.txt" ;_FileWriteFromArray($sFilePath, $aScriptDir, 1) ;_ArrayDisplay($aScriptDir, "1D display") Func Initial() $aScriptDir = _FileListToArray($sDir) for $i = 1 To UBound($aScriptDir) - 1 $dHash = _Crypt_HashData($i, $CALG_MD5) ;ConsoleWrite("File " & $aScriptDir[$i] & " is " & $dHash & @CRLF) ConsoleWrite($aScriptDir[$i] & ":" & $dHash & @CRLF) ;Hush($aScriptDir[$i]) ;FileWrite $hFileOpen = FileOpen($sFilePath, $FO_APPEND) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") EndIf FileWrite($hFileOpen, $aScriptDir[$i] & ":" & $dHash & @CRLF) Next EndFunc Func Monitor() $aScriptDir = _FileListToArray($sDir) for $i = 1 To UBound($aScriptDir) - 1 Next EndFunc Func LoadTripwireDB() $comparison_ok = false $dArray = _FileListToArray($sDir) ;directory $dArray0 = UBound($dArray) - 1 $fArray = FileReadToArray($sFilePath) ;file $fArray0 = UBound($fArray) ;_ArrayDisplay($dArray, "files array") if $dArray0 = $fArray0 Then ; are file same as recorded in txt file? ;ConsoleWrite("files in monitoring dir: " & $dArray[0] & " = file recorded: " & $fArray0 & @CRLF & $fArray[0]& @CRLF) for $i = 1 To UBound($dArray) - 1 ;ConsoleWrite("i = " & $i & @CRLF) $dHash = _Crypt_HashData($i, $CALG_MD5) ;binary ;$dHash = BinaryToString($dHash) $ffhash = StringSplit( $fArray[$i-1],":") $fhash = $ffhash[2] ;ConsoleWrite("IsBinary $dHash " & IsBinary($dHash) & @CRLF) if $dHash = $fhash Then ;if compared hashes are equal ;ConsoleWrite($fhash & ":" & $dHash & " equal" & @CRLF) ;ConsoleWrite("File: " & $fhash & @CRLF & "Directory: " & $dHash & @CRLF & "equal: yes " & @CRLF) Else ;if compared hashes are not equal ;ConsoleWrite("File: " & $fhash & @CRLF & "Directory: " & $dHash & @CRLF & "equal: not " & @CRLF) ;MsgBox(0,"hash md5",$fhash & ":" & $dHash & " not equal") EndIf Next ;ConsoleWrite("hashes are equal" & @CRLF) $comparison_ok = true Else ConsoleWrite("number of files in monitoring dir are not same as recorded" & @CRLF) ConsoleWrite("directory: " & $dArray[0] &":"& "files: " & UBound($fArray) - 1 & @CRLF) EndIf Return $comparison_ok EndFunc #main if LoadTripwireDB() = true Then ConsoleWrite(" hashes are equal " & @CRLF) ElseIf LoadTripwireDB() <> true Then ConsoleWrite(" hashes are not equal " & @CRLF) ConsoleWrite(" hashes are not equal " & @CRLF) Initial() EndIf  
      tripwire.au3
      tripwire.txt
    • AlecSadler
      By AlecSadler
      Hello friends, today I am sharing a script I've been working on called secure interface module.
      It's a SSL encrypted Instant Messenger, with optional 4D Holographic Encryption. (See THIS thread for more info about DARTIS)
      To sign up for an account visit https://pdglobal.net (You will need to use a valid email)
      Script is attached, to use just extract and run SIM32.exe or SIM.au3
      Warning: There might be bugs. This is an early alpha version, if you find something that needs fixed, please fix it if you can or report it here in the thread so I can look into fixing it.
      Download: https://pdglobal.net/?pid=SIM#SIM

    • Glyph
      By Glyph
      Has anyone already worked on a WSS UDF yet? I'm interested in making a project involving WSS with the ASYNC autoit library like ratchetphp / Pawl in PHP. (using reactphp)
      ASYNC is a must, and obviously WSS. the problem with some libraries i've worked with in PHP are mainly issues with handshakes like improper peer name validation (for multi level certs)
      relevant links: https://tools.ietf.org/rfc/rfc6455.txt
      https://github.com/ratchetphp/Pawl
       
      /e i should note i'm not looking for hybrid workarounds, i want to do this in autoit alone. (no javascript)
    • 5ervant
      By 5ervant
      What's the best way to receive file from a desktop app?
      app.exe will execute a cmd with "au3file.exe /path/of/the/file.xml" and the au3file.exe will get and delete that. Or else? THE MOST IMPORTANT PART OF THE QUESTION
      And best way to transfer file to a desktop app?
      au3file.exe do a $_POST request and the app.exe MUST HAVE a local HTTP server that can receive $_POST, but it looks heavy 'cause the app must have a server such XAMPP. au3file.exe execute a cmd with "app.exe /path/of/the/file.xml" and the app.exe will now get that file and delete. Or else?