DeleteFileFromAppW function (fileapifromapp.h)

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

WINSTORAGEAPI BOOL DeleteFileFromAppW(
  LPCWSTR lpFileName
) noexcept;

Parameters

lpFileName

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 Files, Paths, and Namespaces.

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

Requirement Value
Minimum supported client Windows 10, version 1803
Header fileapifromapp.h