Enable the "Undo Move" context menu after File.Move

16 hours ago 3
ARTICLE AD BOX

I want to move a file programmatically from one folder to another, and when the file is moved I want to be able to undo the move manually using the Windows Explorer "Undo Move" context menu. This option normally appears after moving manually a file, and then right-clicking on an empty space in the Windows Explorer.

Undo Move Ctrl+Z

I tried both the File.Move and the FileSystem.MoveFile, and neither enables the Undo. Is there any other .NET API that does the trick?

For context, the FileSystem.DeleteFile API enables successfully the similar "Undo Delete" context menu:

FileSystem.DeleteFile(path, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);

So I am hoping that enabling the "Undo Move" should also be possible somehow.

Related VB.NET question, with a single non-promising answer.

Read Entire Article