Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? DO Command and "&" Characters Embedded in Filenames

Dec
231
2
I have been trying to use the Do Command on a directory but when it hits a file with an embedded "&" in the filename, it only parses to the the "&" and stops and load the partial value into the loop variable. Is there a way to fix this, away to get the full name instead of the partial name?

Thanks
 
Quote the variable if its value might contain an ampersand:

Code:
do file in c:\mydir\* ( echo "%file" )

... not ...

Code:
do file in c:\mydir\* ( echo %file )
 

Similar threads

Back
Top