@echo off set "TARGET_DIR=node_licenses" if not exist "%TARGET_DIR%" mkdir "%TARGET_DIR%" echo [1/3] Copying licenses... for /r "node_modules" %%f in (*LICENSE* *LICENCE* *COPYING*) do ( if not exist "%%f\" ( for %%p in ("%%f\..") do copy /y "%%f" "%TARGET_DIR%\LICENSE.%%~nxp.txt" >nul ) ) echo [2/3] Licenses saved in \%TARGET_DIR%\ echo [3/3] Running modclean... call npx modclean -n default:safe -r echo Done! Offline-ready and legally safe.