Windows – Viewing Windows Explorer’s complete Undo history

undowindowswindows xpwindows-explorer

Background

Windows Explorer maintains a list of file operations so that you can undo them (10 operations up to XP and 32 from Vista). You can see the last operation without performing it by opening the Edit menu, and highlighting the Undo command without selecting it and looking at the status bar (though even then, it often does not work and only shows a blank string in the status bar).

Problem

Unfortunately not only does this show the operation in the status bar, which by default is not enabled, but this only shows the last operation. Even worse, it only shows the operation and file’s name, not the path(s).

Use-case scenario

An example use is if you are renaming and moving a bunch of files—especially similarly named files like download1.png, download2.png, etc.—then realize that you forgot to move one of the files after renaming it. Seeing the list of the last several filenames and paths modified would allow you to figure out which one was missed without having to undo all of the subsequent operations which might make a complete mess of things.

Question

Does anyone know of a way to get a list of all of the operations that Windows has stored in its Undo buffer? I have seen program that can hook into Windows and do things that are unsupported like rearranging taskbar and tray icons (XP did not support that), so I am hoping that someone has managed to do the same with the Undo buffer.

Best Answer

Hopefully, I correctly get what You are looking for. If so, there seems to be WinAPI method - ReadDirectoryChangesW that might do what You expect.

I am not sure if following approach will work with file operation history or only display changes made after the time it is used, however, as this approach is not that different and might be used in scenario You provided, I will mention that even it might be slightly off-topic:

You could be able to connect FileSystemWatcher object to a folder (yet the link's topic is different, this IMHO gives nice overview of the class purpose) – it is C# .NET class, I know, but what is C# can be made PowerShell as shown by this script from Microsoft's Script Center.

You might consider a 3rd party solutions such as Windows Explorer tracker that seems to do the same (I believe they rather use (documented) API calls than reverse-engineering techniques – but You seemed bit concerned about them, so I only looked-up one).

And last but not least, You might even consider writing a simple WPF application based on FileSystemWatcher or bit more complex WPF application calling ReadDirectoryChangesW method.

Related Question