Viewing Windows Explorer’s complete Undo history

7,785

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.

Share:
7,785

Related videos on Youtube

Synetech
Author by

Synetech

Sadly, I’ve become soured by the SE network. It started great, but went downhill. Some mods are too aggressive/bias, policies are arbitrarily/capriciously/selectively applied, and some users treat the sites as MMOGs, “rep-whoring”, copying others’ work, and posting random guesses to game the system by abusing and exploiting auto-bounty assignment. I care(d) about the integrity of the site, so I feel anywhere that allows such disreputable behavior isn’t somewhere worth staying. My OCD not withstanding, I won’t be contributing much here anymore and will find somewhere else to help people. I apologize to all of the people I would have helped here in the future. Press the chemise key to continue… 😈 Images As a visual-learner, I often add images to my posts to make them more effective. Sometimes I take photos, sometimes I create them with software, sometimes I find them through Google Images or Wikipedia. Mod I’ve been asked hey bro, y u no b mod? get u POWR! impr0ve site (or some other variation). I had considered it and was even tempted to run a few times, but I just have too much to do already, so I can’t take on that kind of commitment when I know I won’t be able to do as good a job as I’d like, or as Sweet Brown would say, ain’t nobody got time fo’ dat. Besides, as the behavior of the other mods became more and more apparent, I realized that it would be pointless.

Updated on September 18, 2022

Comments

  • Synetech
    Synetech over 1 year

    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.

    • Costin Gușă
      Costin Gușă almost 11 years
      xp does support rearranging taskbar program positions - via a third party utility called taskbar shuffle
    • Synetech
      Synetech almost 11 years
      @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).
    • ADTC
      ADTC over 4 years
      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.
  • Nostromov
    Nostromov about 7 years
    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!! :))