Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    /c just closes the cmd without even waiting for the command to complete execution. Is there a way for it to wait until the command is executed completely and then close the command prompt automatically? Or if any other way to run multiple commands on the new cmd window? Commented Oct 23, 2019 at 9:42
  • No. From the windows command reference linked in the answer: /c Carries out the command specified by String and then stops. Commented Nov 1, 2019 at 17:45
  • Note, that if command needs to be multiple commands, && must be escaped with ^ e.g. echo hello ^&^& cd x ^&^& dir See: stackoverflow.com/questions/34698230/… Commented Jan 6, 2024 at 21:13
  • Run cmd /? to check the help instead of trusting answers you find online: /C Carries out the command specified by string and then terminates. (The docs say the same.) You can remember that /c is for close and /k is for keep. Commented Aug 7 at 16:42