DEV Community

Cover image for Delete JavaScript projects like a pro 🔥
Andronik Nazaryan
Andronik Nazaryan

Posted on

Delete JavaScript projects like a pro 🔥

Works only on Windows

  1. create new file call it frm.bat (command name can be anything)
  2. open with your favourite code editor and paste the following code
  3. move it into Program Files (x86) to be available for Powershell
@echo off 

if "%~1"=="" (
    echo No parameters have been provided.
    echo ex: frm {file/folder}
) else (
    if exist %1\* (
        echo Removing %1 with recursion please wait...
        cmd "/C rm -r %1 -f"
        echo %1 removed.
    ) else (
        echo {%1} doesn't exist
    )
)
Enter fullscreen mode Exit fullscreen mode

You are done, open Powershell and type

/frm {folder name}

all this simple code does is running native powershell command
rm -r {folder_name} -Force

this is my first post hope it helps ♥

Top comments (0)