16

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.

3
  • xp does support rearranging taskbar program positions - via a third party utility called taskbar shuffle Jul 9, 2013 at 17:25
  • 1
    @CostinGușă, actually, there were several programs that let you rearrange the taskbar and tray icons, but like you said, they were third-party. This is because Windows did not support the action (Microsoft made assumptions about user behavior), so they had to reverse-engineer the functions to figure out a way to do it because there was no official hooks to allow it to happen (I myself once had to reverse-engineered the registry entry that controls the tray-icon display behavior in order to write a viewer/editor for it).
    – Synetech
    Jul 9, 2013 at 21:20
  • 2
    In Windows 10 the status bar doesn't display anything when highlighting Undo/Redo in the folder's right-click menu. Annoyingly the Ribbon doesn't have any buttons for this. The workaround is, you have to add the Undo/Redo buttons to the Quick Access Toolbar (the tiny toolbar on the title bar), and then point at each of the buttons to view the details of their operation. (Of course, you still can't see the paths or the full history.) PS: Some operations like redoing a delete seems to clear the whole history, so be careful with that.
    – ADTC
    Sep 25, 2019 at 2:31

1 Answer 1

6

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.

1
  • This could, very well, be one of the most comprehensive answers -ever- on superuser.com/ Thank you, for the links and for your AWESOME effort, very nice!.. Thanks!! :))
    – Nostromov
    Feb 7, 2017 at 3:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .