What is the proper way to test if a parameter is empty in a batch file?

Use square brackets instead of quotation marks:

IF [%1] == [] GOTO MyLabel

Parentheses are insecure: only use square brackets.

Leave a Comment