Partager via


SHFileOperation

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This function can be used to copy, move, rename, or delete a file system object.

Syntax

int SHFileOperation(
  LPSHFILEOPSTRUCT lpFileOp
);

Parameters

  • lpFileOp
    [in] Address of an SHFILEOPSTRUCT structure that contains information this function needs to carry out the specified operation.

Return Value

Returns zero if successful, or nonzero otherwise.

Remarks

You should use fully qualified path names with this function. Using it with relative path names is not thread-safe.

When used to delete a file, SHFileOperation attempts to place the deleted file in the Recycle Bin. If you wish to delete a file and guarantee that it is not placed in the Recycle Bin, use DeleteFile.

Requirements

Header shellapi.h
Library ceshell.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

Standard Shell Functions
SHFILEOPSTRUCT

Other Resources

DeleteFile