Home > Software design >  Unable to run command on Batch File
Unable to run command on Batch File

Time:02-03

I have a batch file to open directories on Windows Terminal.

Currently there are 2 lines on my script:

cmd.exe /c wt.exe --window 0 new-tab --profile "RAN" --title "Components" --tabColor "#8AD8FF" --colorScheme "One Half Dark" -d "C:\RAN\components-page"

And have a one for multiple panes:

cmd.exe /c wt.exe --window 0 new-tab --profile "RAN" --title "Address" --tabColor "#9C37FF" --colorScheme "One Half Dark" -d "C:\RAN\address-page" ; split-pane -V -p "RAN" --title "Address Info" --tabColor "#9C37FF" -d "C:\RAN\address-info-page"

The thing is that it does work to open I get a page like this:

What the command loads

What I would like to do is simple to have that but in the same script make it start my pages, by doing by running the command yarn start:local in that directory, as currently I can only do it manually.

Is there a way to do this?

I have added at the end of the -d (directory address) a && yarn start:local.START but hasn't work, no other online info I tried has work so far.

CodePudding user response:

Seeing that you are using powershell in Windows Terminal, you can just add at the end: powershell -NoExit "yarn start:local". So you're end command would be something like:

cmd.exe /c wt.exe --window 0 new-tab --profile "RAN" --title "Components" --tabColor "#8AD8FF" --colorScheme "One Half Dark" -d "C:\RAN\components-page" powershell -NoExit yarn start:local
  • Related