Skip to content

Instantly share code, notes, and snippets.

@krishnathota
Created October 22, 2021 03:54
Show Gist options
  • Save krishnathota/4a281f18c3713d7f6b28acafbc79e7a3 to your computer and use it in GitHub Desktop.
Save krishnathota/4a281f18c3713d7f6b28acafbc79e7a3 to your computer and use it in GitHub Desktop.
Delete with Rimraf from context menu
Install the node module rimraf globally
npm i -g rimraf
Copy the delete.bat file into system32
Run the reg file below or follow the below steps
In Regedit go to -> HKEY_CLASSES_ROOT\Directory\shell\
Right-click on Shell and select New > Key
Name the key' Delete with Rimraf'
Right-click on 'Delete with Rimraf', and select New > Key
Name the key 'command'
Double-click on default of the command key
Add cmd /c "cd %1 && delete.bat" as the value
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Delete with rimraf]
@=""
[HKEY_CLASSES_ROOT\Directory\shell\Delete with rimraf\command]
@="cmd /c \"cd %1 && delete.bat\""
@ECHO OFF
ECHO.
ECHO %CD%
ECHO.
ECHO Are you sure to delete the folder with Rimraf?
PAUSE
SET FOLDER=%CD%
CD /
rimraf "%FOLDER%"
rem DEL /F/Q/S "%FOLDER%" > NUL
rem RMDIR /Q/S "%FOLDER%"
EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment