0

I want to create .bat file to open cmd.exe in Windows Terminal and activate python environment

cd D:\pythonApp
venv\Scripts\activate

this successfully open cmd in Terminal and set the directory

wt.exe -d "D:\pythonApp" cmd

but I it failed to run venv\Scripts\activate

wt.exe -d "D:\pythonApp" cmd; venv\Scripts\activate

it open 2 tab with error: Termination behavior can be configured at advance profile settings

1 Answer 1

0

from the docs

wt [options] [command ; ]

but the problem there are no mention we should place the command inside quote, so the solution for my problem is "cmd /k venv\Scripts\activate"

CMD

wt -d "D:\pythonApp" "cmd /k venv\Scripts\activate"

PowerShell

wt -d "D:\pythonApp" -p "Windows PowerShell" "powershell -NoExit  venv\Scripts\activate"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .