1

I often use .bat scripts that delete, copy, paste, rename, or move files. I'm not sure that when I execute one of these .bat scripts that I will be able to use the Windows Explorer 'Undo' function (and 'Redo' if something was 'undone').

For example, if I have a .bat script that simply deletes a file:

DEL /F /S /Q /A "E:\Testing\branches\blue.jpg"

will I then be able to use CTRL+Z to undo this action that was executed by the .bat script?

Lastly, do all functions get treated the same way (rename, move, delete, copy, paste etc) when an undo/redo is used for commands executed by .bat scripts?

Running Window 10 pro 64 bit

1
  • 1
    You could just try it out on some dummy files instead of waiting for an answer.
    – cup
    Commented May 6, 2023 at 19:54

1 Answer 1

1

No, they are not affected. Undo/Redo in Windows Explorer are specifically for operations made through Explorer – they possibly might apply to functions that specifically call Explorer shell interfaces, but in nearly all cases (except perhaps file deletion via Recycle Bin) programs completely bypass Explorer when dealing with files and directly use the lower-level interfaces.

Moreover, even within Explorer you cannot undo a deletion – you can only undo a move to Recycle Bin, but Cmd.exe's DEL does not use the Recycle Bin, it literally deletes the file.

1
  • Thank you. This was just the confirmation I was looking for. Commented May 7, 2023 at 1:04

You must log in to answer this question.

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