FileRecycle

AutoHotkey

FileRecycle

Sends a file or directory to the recycle bin, if possible.

FileRecycle, FilePattern

Parameters

FilePattern

The name of a single file or a wildcard pattern such as C:\Temp\*.tmp. FilePattern is assumed to be in %A_WorkingDir% if an absolute path isn't specified.

To recycle an entire directory, provide its name without a trailing backslash.

ErrorLevel

[v1.1.04+]: This command is able to throw an exception on failure. For more information, see Runtime Errors.

ErrorLevel is set to 1 if there was a problem or 0 otherwise.

Remarks

SHFileOperation is used to do the actual work. This function may permanently delete the file if it is too large to be recycled; as of [v1.0.96], a warning should be shown before this occurs.

Related

FileRecycleEmpty, FileDelete, FileCopy, FileMove

Example

FileRecycle, C:\temp files\*.tmp