DeleteFileFromApp function

Deletes an existing file. The behavior of this function is identical to DeleteFile, except that this function adheres to the Universal Windows Platform app security model.

Syntax


BOOL WINAPI DeleteFileFromApp(
  _In_ LPCWSTR lpFileName
);

Parameters

lpFileName [in]

The name of the file to be deleted.

In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.

For the unicode version of this function (DeleteFileFromAppW), you can opt-in to remove the MAX_PATH character limitation without prepending "\\?\". See the "Maximum Path Limitation" section of Naming Files, Paths, and Namespaces for details.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero (0). To get extended error information, call GetLastError.

Requirements

Minimum supported client

Windows 10, version 1803 [desktop apps only]

Minimum supported server

Windows Server [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

DeleteFileFromAppW (Unicode) and DeleteFileFromAppA (ANSI)

 

 

Show: