You are not logged in.
Pages: 1
On windows 10 this does not work:
FOR %%G IN (c:\program^ files\MyFile.txt) DO copy %%G d:\backups\
Though I'm pretty sure this worked on older versions of windows (may be Vista...)
the only way to escape spaces is to use quotes.
Same for for /d (which also can be used for iteration of items)
Offline
I don't recall ever seeing caret used for space escaping (or having it succeed myself). Not really sure why you would when dquote works.
Just tried on Server 2008R2 and it doesn't work. Don't have anything older to hand.
cmd | *sh | ruby | chef
Offline
In windows 7 it fails too.
for %%A in (one^ two) do echo #%%A#
Output
#one#
#two#
Offline
I don't recall ever seeing caret used for space escaping (or having it succeed myself). Not really sure why you would when dquote works.
Just tried on Server 2008R2 and it doesn't work. Don't have anything older to hand.
I raised the flag because it is on the help page: https://ss64.com/nt/for2.html
and the double quotes are not mentioned on the for /d help page: https://ss64.com/nt/for_d.html
Offline
Thanks for flagging this up npocmaka, I'm travelling at the moment but will fix up that page in a few days time.
Offline
Though I'm pretty sure this worked on older versions of windows (may be Vista...)
I can't get this to work in XP SP3.
Offline
Pages: 1