Reputation: 1175
I'm trying to implement this simple algorithm:
If there are no directory "Abc", then create it.
Despite of the existing or non-existing of Abc, echo me "Hello".
But for some reason, I see greeting only if Abc wasn't created yet.
if not exist "Abc" mkdir Abc & echo Hello
How I may fix it?
Upvotes: 0
Views: 37
Reputation: 16236
cmd
is putting the & portion with the mkdir
. If the directory is not created, the & portion is never executed.
(if not exist "Abc" mkdir Abc) & echo Hello
Upvotes: 2