Skip to content

Instantly share code, notes, and snippets.

@noseratio
Last active June 15, 2023 17:29
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save noseratio/6961e9c4d54741e01ca705e7ff1d0c80 to your computer and use it in GitHub Desktop.
Save noseratio/6961e9c4d54741e01ca705e7ff1d0c80 to your computer and use it in GitHub Desktop.
Delete node_modules recursively on Windows
@echo off
set folders=node_modules
echo This will delete all [%folders%] folders recursively and cannot be undone.
choice /t 10 /d n /c yn /m "Press Y to continue, N to stop"
if %errorLevel% neq 1 goto :EOF
for /d /r . %%D in (%folders%) do if exist "%%~fD\" (echo %%D && rd "%%~fD" /s /q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment