1

Here are the commands in batch:

D:
cd D:\Startup\venv\Scripts
activate
cd D:\Startup\
python manage.py runserver

Commands after "activate" are not executed for some reasons. I tried to put "cmd /k activate" instead "activate" but result is still the same except the command line is still open. What is wrong here

2
  • I've no clue what activate is and what it does. Commented Jan 21, 2016 at 7:42
  • @Falko it launches python environment Commented Jan 21, 2016 at 8:08

1 Answer 1

3

I suppose activate is a batch file and therefore needed is:

cd /D D:\Startup\venv\Scripts
call activate.bat
cd D:\Startup
python.exe manage.py runserver

Without command call the processing of a batch file continues on other batch file without returning which is the reason why the last two lines where never executed. Run in a command prompt window call /? and read output help and for more details see for example also answer on How to call a batch file in the parent folder of current batch file?

Command CD with parameter /D makes it possible to change directory and drive at the same time as cd /? executed in a command prompt window explains.

In batch files it is advisable to specify batch files and executables with file extension.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you @Mofi , this is what I've been looking for

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.