0

I want to create a batch file that would execute two commands one after the other, and then keep the CMD window open. The following is what I tried, after some searching on the internet, but only the first command is getting executed. What am I missing?

cmd /k C:\Users\Hp\yolo\test1\.env1\Scripts\activate && cd C:\Users\Hp\yolo\test2

I also tried with just one '&' instead of two, but that doesn't work either. Only the first command gets executed in both cases.

2
  • If you read the help file for CMD.exe: Note that multiple commands separated by the command separator are accepted for string if surrounded by quotes. Commented Feb 28, 2017 at 13:39
  • Thanks @Squashman. It works! Commented Mar 8, 2017 at 11:15

1 Answer 1

1
doskey /macrofile=%~dp0adb_macros.txt 

color 9F 

cmd /K 

For those who came here for an example of an actual answer

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

1 Comment

Yes, that. No need to squeeze everything into just one line within a batch file.

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.