Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way to disable the CTRL+Z (Undo) shortcut in Windows Explorer? Alternatively, is there a way to have Windows Explorer "forget" its undo history?

The reason I ask is that you may have done some file operations in Explorer (copying, renaming, etc.), and perhaps you don't reboot for days or longer (choosing to hibernate instead). The problem is that if you accidentally hit CTRL+Z one or more times (often mistaking which application you have in the foreground; using a dual-monitor setup will increase that likelihood), you may be undoing something that was done ages ago without realizing what happened.

Even if you do realize what has happened, you may not remember what the last several operations were that you did potentially days ago. As far as I can tell, there is no "Redo" function in Windows Explorer to save you. I can imagine scenarios in which this mistake could cause lots of problems.

If the shortcut can be disabled, it would at least force you to use the Edit > Undo menu item before doing something stupid. Otherwise if the undo history could be periodically cleared, that would prevent some very old operations from being undone.

Addendum: For those interested in implementing this, I created an AHK file that runs silently (the #NoTrayIcon option) from my Windows Startup folder. Besides some other useful shortcuts I incorporated, this is what it looks like:

#NoTrayIcon
SetTitleMatchMode RegEx
return

; Disable Ctrl+Z shortcut in Windows Explorer
;
#IfWinActive ahk_class ExploreWClass|CabinetWClass
^z::return
#IfWinActive

If you prefer feedback instead of CTRL+Z simply doing nothing, play a default sound or use MsgBox to cause a dialog to appear.

#IfWinActive ahk_class ExploreWClass|CabinetWClass
^z::
    ;Uncomment the feedback option you prefer below
    ;SoundPlay *-1
    ;MsgBox Ctrl+Z has been disabled.
return
#IfWinActive
share|improve this question

1 Answer

up vote 4 down vote accepted

I think you can have Autohotkey override an existing shortcut.

^z::
return

Will make Ctrl + z do nothing

Edit: This will apply everywhere. To apply in explorer only, try this:

#IfWinActive ahk_class ExploreWClass
^z::
#IfWinActive ahk_class CabinetWClass
^z::
return
#IfWinActive
share|improve this answer
Thanks, this is a great little utility! I've edited your answer to include also the ExploreWClass as Explorer can run as either depending on how it is launched. The trailing #IfWinActive should be used so the hotkey doesn't fall through to any commands in the script beneath it. – JustinStolle Apr 8 '11 at 15:44
1  
@Justin: loads better, thanks for the edit! – outsideblasts Apr 8 '11 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.