DEV Community

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

Posted on

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)