Replace delete action

Page 1 of 2 12 LastLast

  1. Posts : 22
    Windows 10
       #1

    Replace delete action


    Greetings,
    is there any way to replace the default action performed when i press the del key (or rightclick > delete) within Explorer process? (maybe via registry edit?)

    Like instead of moving to recycle bin i whish to call an executable with that particular file as argument

    Action to be performed:
    C:\stuff\WipeFile.exe "%cd%\[filename]"
      My Computer


  2. Posts : 8,114
    windows 10
       #2
      My Computer


  3. Posts : 14,023
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #3

    Historically, since Win95 one has been able to hold down the Shift key while pressing/clicking Del/Delete to bypass the Recycle Bin but that removes the chance to recover a file unless using third-party software for the purpose.
      My Computers


  4. Posts : 31,691
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #4

    The OP doesn't just want to bypass the recycle bin, they want to run an executable that (judging by its name) would secure-wipe the selected file. I would suggest adding it as a custom action on the right-click 'Send to' menu.

    Just create a shortcut to the WipeFile.exe in %AppData%\Microsoft\Windows\SendTo

    This will run WipeFile.exe and pass the full path to the selected file as an argument to WipeFile.exe.

    Barnack said:
    Action to be performed:
    C:\stuff\WipeFile.exe "%cd%\[filename]"
    What exactly is your %cd% bit supposed to do?
      My Computers


  5. Posts : 22
    Windows 10
    Thread Starter
       #5

    Bree said:
    The OP doesn't just want to bypass the recycle bin, they want to run an executable that (judging by its name) would secure-wipe the selected file. I would suggest adding it as a custom action on the right-click 'Send to' menu.

    Just create a shortcut to the WipeFile.exe in %AppData%\Microsoft\Windows\SendTo

    This will run WipeFile.exe and pass the full path to the selected file as an argument to WipeFile.exe.



    What exactly is your %cd% bit supposed to do?
    Well since i already made a batch with a custom del command i just copy pasted without noticing, it was to get the full path of the file because the program i'm using crashes if the argument doesn't have absolute path.
      My Computer


  6. Posts : 22
    Windows 10
    Thread Starter
       #6

    Berton said:
    Historically, since Win95 one has been able to hold down the Shift key while pressing/clicking Del/Delete to bypass the Recycle Bin but that removes the chance to recover a file unless using third-party software for the purpose.
    Wiping a file isn't just deletion. A wiped file ideally cannot be restored.
      My Computer


  7. Posts : 31,691
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #7

    Barnack said:
    Well since i already made a batch with a custom del command i just copy pasted without noticing, it was to get the full path of the file because the program i'm using crashes if the argument doesn't have absolute path.
    Well, then it should have no problem if you use the 'Send to' menu as I suggested. Windows will provide the full path and filename as an argument to your program.
      My Computers


  8. Posts : 22
    Windows 10
    Thread Starter
       #8

    Bree said:
    Well, then it should have no problem if you use the 'Send to' menu as I suggested. Windows will provide the full path and filename as an argument to your program.
    That's convinient, didn't know; thanks!
      My Computer


  9. Posts : 31,691
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #9

    Yes, you can test that for yourself. Just copy and paste these commands into a ShowMe.bat file on your Desktop. Then move it into %AppData%\Microsoft\Windows\SendTo
    (you don't have permission to create or edit files there, you can only create new shortcuts).

    @ECHO OFF
    ECHO The file is: %1
    PAUSE
      My Computers


  10. Posts : 22
    Windows 10
    Thread Starter
       #10

    Perfect, it actually worked as intended. Next step: coding my own file wiper to work as i want it to, but that's a matter for another forum xD
    Thanks Bree!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 15:22.
Find Us




Windows 10 Forums