Run a .bat file with CMDER

2

1

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

Maverick

Posted 2015-11-25T11:28:52.960

Reputation: 121

Answers

0

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.

MinchinWeb

Posted 2015-11-25T11:28:52.960

Reputation: 41