Direct access to disks and protected files from user-mode applications in Windows

RawDisk.DeleteFile method


Pascal    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   



Deletes the file being locked by other process or inaccessible in other way due to security constraints.


    class procedure DeleteFile( FileName : WideString; LicenseKey : WideString);

[C++ (DLL/Lib)]
    static void DeleteFile( unsigned short* FileName, unsigned short* LicenseKey);

[C++ (VCL)]
    static void __fastcall DeleteFile( WideString FileName, WideString LicenseKey);

[C++ (.NET)]
    static void DeleteFile( String^ FileName, String^ LicenseKey);

    static void DeleteFile( string FileName, string LicenseKey)

    Shared Sub DeleteFile( ByVal FileName As String, ByVal LicenseKey As String)


  • FileName - The name of the file to be deleted.
  • LicenseKey - The license key. RawDisk doesn't work without the license key (either production or evaluation). You can request the evaluation license key via request form.


Use this method to delete the file. The method is useful when the file is exclusively opened by some other process or when you need to bypass security restrictions.

If the method fails for whatever reason, an exception with Windows-defined error code is thrown.

Back to top