Answer the question
In order to leave comments, you need to log in
How do you know if a variable contains at least one space?
The variable contains the name of the folder in which the cmd file is located
Not the path but only the name
But it is not known whether this name contains spaces
How to find out that there are spaces there to wrap in quotes before passing to the parameter?
Answer the question
In order to leave comments, you need to log in
set varcount=0
for /F "tokens=2" %%a in (%string%) do set /A varcount+=1
if not %varcount%==0 (
set string="%string%"
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question