Answer the question
In order to leave comments, you need to log in
What does the strange entry in the cmd file mean?
Hello!
I found something strange in the file some.cmd:
(the name of the script was given from the bullshit).
if -%1-==-- (
echo Error!!
exit 1
)
Answer the question
In order to leave comments, you need to log in
Found:
https://superuser.com/questions/948204/what-does-h...
Quote from the same link: "Generally, it is better to use conventional approaches that more people will more immediately understand" :))
Everything is very simple - imagine what will happen if you do not specify the first parameter when running the script?
There will be a syntax error. Framing minuses are needed so that there is no mistake. But it's more correct to use quotes for this purpose: if "%1" equ ""
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question