Read items into a file whose name contains some space from a batch script -


i need read items inside files batch script. name of items' file contains spaces. that, use file name parameter, surrounded double quotes in order take account file names spaces.

read.bat  /f %%a in ("%~1") echo %%a>>result.txt  conf file.txt  projectid: biew  artifactid: sprint1 

batch running 'read.bat conf file.txt'. instead having result.txt

 projectid: biew  artifactid: sprint1 

i "conf", first part of file name. helping me!

you should use "delims=", session protocol:

 >type read.bat @for /f "usebackqdelims=" %%a in ("%~1") @echo %%a  >type "conf file.txt" 1 2 3 4 5  >read.bat "conf file.txt" 1 2 3 4 5 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -