Executing things on console2 startup

3.6k views Asked by At

I am using console2 and I am trying to execute a few simple things when I fire console2 like

set PATH=%PATH%;C:\MyPgm\Git\bin

How can I do such things. And on the side is there somewhere I can find example of nice configs of console2

2

There are 2 answers

1
nobleCoder On BEST ANSWER

The version I am working with is 2.00.148

  • First, create a batch file (*.bat) with any name you like ("shell.bat") and add the lines to be executed on the start up of the console.. additionally you have to add "cmd" (or "bash") command at the end of file to open up the command shell...the file will be like that

    @echo off

    set PATH=%PATH%;C:\MyPgm\Git\bin

    cmd

  • then run console2 ..from Main Menu > Edit > Settings > "Console" Node .. and press ".." button beside "shell" field ,select "*.bat" file type then select the file you created earlier OR write down the path to this file..(you can also set working directory in "startup dir")...save and restart

that's it !! Enjoy !!

0
worrawut On

My use case is that I would like to run a command just after start the console2, in this case it is a command to set ruby version. The process is similar to @nobleCoder

  1. create the .bat file, I name it ruby_setup.bat
@echo off
set init_ruby_243=uru 243p205
cmd.exe  /k "%init_ruby_243%"
  1. specify .bat file to execute when start the console2 by going to Edit > Settings then at the Shell field select the file ruby_setup.bat or manually input it like C:/users/myname/ruby_setup.bat then save and restart.

Hope this help.