foxidrive wrote:
On Tue, 17 Jun 2008 22:02:48 -0400, "Todd Vargo"
<
[email protected]>
wrote:
foxidrive wrote:
billious wrote:
thinktwice wrote:
seems i can't add quote around the parameter.
if "%1" == "" @echo Usage: check_dir Path
Batch interprets space, comma and semicolon as separators
where the
argument
string is unquoted.
Try
if "%*"=="" echo .....
Also try this.
if "%~1"=="" @echo Usage: check_dir Path
And this.
if (%~1)==() @echo Usage: check_dir Path
That will fail if %1 contains spaces etc Todd.
I forgot to remove the tilde.
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal
messages)
... it'll still fail under the same condition.
--
Dean Wells [MVP / Directory Services]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l
My mistake ... didn't think that through sufficiently; that'll
work.
Yes, when comparing to a null string such as ().
But in the general case where a parameter could be supplied by
dragging and dropping a file, this does not account for the fact
that double quotes will be added only when required. I prefer the
"%~1" method because it strips the double quotes that may be
present, relieving me from having to remember whether or not the
double quotes are required to the string literal being compared.
/Al