Advertisement
FreeBooter

PermanentDelete

Mar 19th, 2024 (edited)
776
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.08 KB | None | 0 0
  1. :: Add Permanently Delete to Context Menu in Windows 10 and Windows 11
  2.  
  3. @Echo Off
  4.  
  5. (Net session >nul 2>&1)||(PowerShell start """%~0""" -verb RunAs & Exit /B)
  6.  
  7.  
  8. :_Ask
  9. Cls & Mode CON  LINES=11 COLS=90 & Color 0E & Title Created By FreeBooter
  10. Echo.
  11. Echo.
  12. Echo.
  13. Echo.      
  14. Echo        Do You Want To Add "Permanently Delete" to Context Menu (A)?  
  15. Echo.      
  16. Echo        Do You Want To Remove "Permanently Delete" from Context Menu (R)?
  17. Echo.
  18.  
  19.  
  20. Set /p input=:^>
  21.  
  22. If /i  Not %input%==A (Goto :_Ex) Else (Goto :_Start)
  23.  
  24. :_Ex
  25. If /i Not %input%==R  (Goto :_Ask) Else (Goto :_RegRestore)
  26.  
  27.  
  28.  
  29. :_Start
  30.  
  31. Reg add "HKCR\*\shell\Windows.PermanentDelete" /v "CommandStateSync" /t REG_SZ /d "" /f > Nul
  32. Reg add "HKCR\*\shell\Windows.PermanentDelete" /v "ExplorerCommandHandler" /t REG_SZ /d "{E9571AB2-AD92-4ec6-8924-4E5AD33790F5}" /f >Nul
  33. Reg add "HKCR\*\shell\Windows.PermanentDelete" /v "Icon" /t REG_SZ /d "shell32.dll,-240" /f >Nul
  34. Reg add "HKCR\Directory\shell\Windows.PermanentDelete" /v "CommandStateSync" /t REG_SZ /d "" /f >Nul
  35. Reg add "HKCR\Directory\shell\Windows.PermanentDelete" /v "ExplorerCommandHandler" /t REG_SZ /d "{E9571AB2-AD92-4ec6-8924-4E5AD33790F5}" /f >Nul
  36. Reg add "HKCR\Directory\shell\Windows.PermanentDelete" /v "Icon" /t REG_SZ /d "shell32.dll,-240" /f >Nul
  37.  
  38.  
  39.  
  40.  
  41. Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
  42. Echo.
  43. Echo.
  44. Echo.
  45. Echo.
  46. Echo          Permanently Delete Context Menu Enabled  
  47. Echo.
  48. Echo.
  49. Echo.
  50.  
  51. Taskkill /im Explorer.exe /f >Nul
  52.  
  53. Start Explorer.exe
  54.  
  55. ping -n 6 localhost >Nul
  56. Exit
  57.  
  58.  
  59. :_RegRestore
  60.  
  61. Reg Query "HKCR\*\shell\Windows.PermanentDelete"  > Nul
  62.  
  63. If %ErrorLevel% EQU 1 Goto :EOF
  64.  
  65. Reg delete "HKCR\*\shell\Windows.PermanentDelete" /f > Nul
  66.  
  67. Reg delete "HKCR\Directory\shell\Windows.PermanentDelete" /f > Nul
  68.  
  69.  
  70. Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
  71. Echo.
  72. Echo.
  73. Echo.
  74. Echo.
  75. Echo         Permanently Delete Context Menu Removed    
  76. Echo.
  77. Echo.
  78. Echo.
  79.  
  80. Taskkill /im Explorer.exe /f >Nul
  81.  
  82. Start Explorer.exe
  83.  
  84. ping -n 5 localhost >Nul
  85. Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement