0

I have a batch script which is used to launch 2 bots in WSL at Windows login.

C:\Windows\System32\bash.exe -c "/home/roughnecks/go/bin/irchuu"
C:\Windows\System32\bash.exe -c "node /home/roughnecks/bots/Birba/birba.js"

My problem is that only the first line runs, I guess because it outputs stuff in the terminal and "birba.js" doesn't fire unless I "ctrl-c" in terminal, exiting irchuu.

I already tried different combinations, like using "nohup command &" or "command 2>&1 &" but nothing is working as expected and I need help.

Thanks

3
  • Can you try : wsl -e node /home/roughnecks/bots/Birba/birba.js ? Commented Feb 1, 2020 at 12:33
  • It's the same stuff; only the first bot runs, while for the second to fire I have to "ctrl-c" in cmd to stop execution of the first one. Commented Feb 1, 2020 at 15:40
  • I also tried: "start cmd.exe /c <first command> start cmd.exe /c <second command>" but the cmd prompts stay open and I want them to go away... Commented Feb 1, 2020 at 16:16

1 Answer 1

1

Windows bash does not seem to support & to fork a command and continue. From this Windows-related question START /B was suggested which seems to work:

START /B C:\Windows\System32\bash.exe -c "/home/roughnecks/go/bin/irchuu"
C:\Windows\System32\bash.exe -c "node /home/roughnecks/bots/Birba/birba.js"
Sign up to request clarification or add additional context in comments.

3 Comments

Hi. If I go that route, irchuu doesn't run - shell continues and just loads birba. Same if I start birba first... I only get an "init" process in task manager but no "node" (and irchuu loads).
There is an answer to a Windows-related question here: superuser.com/a/591084/205056 - you could try to prepend START /B
Thanks @Jonas Eberle, it's solved finally: start /B C:\Windows\System32\bash.exe -c "/home/roughnecks/go/bin/irchuu" is what I used. If you want to add your answer I'll mark the question solved. stackoverflow.com/users/2819581/jonas-eberle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.