WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: bmcnish on January 07, 2016, 02:51:01 PM

Title: blanks in directory name
Post by: bmcnish on January 07, 2016, 02:51:01 PM
I have a script that does DirExist("%destdir%") where the destdir ihas blanks in the name .  It always fails on this line.  How can I get it return a true value?
Title: Re: blanks in directory name
Post by: td on January 07, 2016, 02:59:05 PM
The DirExist function does not care where or not the input path contains blank characters.  Why are you using substitution and what do you mean by 'fail'?
Title: Re: blanks in directory name
Post by: snowsnowsnow on January 07, 2016, 09:05:05 PM
I would imagine that if the "destdir" variable contains newlines (I.e., CRLF) in it, the above statement would "fail" big time.
Title: Re: blanks in directory name
Post by: td on January 08, 2016, 06:46:33 AM
If by "fail big time" you mean the function returns zero, that is correct.