Run a .bat file with CMDER

batch filecmdercommand line

I have a .bat file that I want to run in Cmder not CMD

echo off
:begin
echo Select a task:
echo =============
echo 1) P1
echo 2) P2
echo -
set /p op=Type option:
if "%op%"=="1" goto op1
if "%op%"=="2" goto op2

goto begin

:op1
start cmd /k cd C:\Users\**\Documents\Projects\P1
cd C:\Users\**\Documents\Projects\P1
grunt serve

:op2
start cmd /k cd C:\Users\**\Documents\Projects\P2
cd C:\Users\**\Documents\Projects\P2
grunt serve

:end

I want when I click on the .bat icon to open Cmder and run commands and also open a new tab in Cmder like I did in cmd (start cmd /k cd C:\Users\**\Documents\Projects\P1).

Thank you in advance.

I found this but didn't help a lot:
https://github.com/cmderdev/cmder/issues/457

Best Answer

Save your above code at %CMDER_ROOT%\config\user-startup.cmd and it will auto run with you start Cmder. The %CMDER_ROOT% folder will be where the Cmder.exe is.

Related Question