How do I include long filenames in the FOR command?

  • Thread starter Thread starter Sam Low
  • Start date Start date
S

Sam Low

Subject says it all. Long file or folder names. " " do not seem to work

Thanks in advance

Sam
 
Hello, Sam:
On Mon, 6 Dec 2004 10:29:02 +0800: you wrote...

SL> Subject says it all. Long file or folder names. " " do not seem to
SL> work

You have to set the tokens to all tokens * as in the example below. For
splits up an item by whitespace so that c:\program files becomes %a =
c:\program and %b = files. Specifying "tokens=*" (note the quotation
marks!) combines all the tokens into one

See for /? for more detail..

for /f "tokens=*" %x in ('dir %windir%\system32\*.dll') do @echo %x

Regards, Paul R. Sadowski [MVP].
 
Back
Top