TransWikia.com

Run 2 commands when starting windows terminal

Super User Asked by Matan Ben Moshe on November 24, 2021

What I want to do is connect to my VPN via rasdial and ssh into my machine when I open a Windows Terminal window, but I can’t figure out how to do both on startup.

I created a new profile, but in the ‘commandline’ section I can’t run more than one command as && or ; don’t seem to work.

Another issue I have is that when I run the rasdial command on startup the window closes immediately.

The syntax in the json file is as follows:
"commandline": "command"

Any help would be appreciated.

One Answer

&& and ; are shell interpreter features, so just call a shell interpreter to make them work:

"command": "cmd /c rasdial this && ssh that"

Should also work with other shells, though PowerShell seems to need a lot of obscure options:

"command": "powershell -NoProfile -Command "rasdial this && ssh that""

Answered by user1686 on November 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP