DEV Community

Cover image for How to Use && in Windows-Based Terminal
Fadhil Radhian
Fadhil Radhian

Posted on

2 1 1 1 1

How to Use && in Windows-Based Terminal

This is a short article on how to use && equivalent in Windows terminals (Powershell & command prompt).

If you try to use && in Windows, you will face an error :

The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorR
   ecordException
    + FullyQualifiedErrorId : InvalidEndOfLine
Enter fullscreen mode Exit fullscreen mode

This happens because Windows does not support && keyword.

What you can replace it with is ; aa. For example :

vagrant up && vagrant ssh

\\ change to :

vagrant up ; aa vagrant ssh
Enter fullscreen mode Exit fullscreen mode

That's it.

Hope it helps !

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay