New
#11
You only need quote-marks around the filename(s) (including the path(s)) if either or both contain spaces. It makes no difference whether you include them or not, but you MUST include them if there is a space anywhere in the relevant filename or path.
Examples (note that Src is the source drive and Dst is the destination drive).
This format will ALWAYS work.Code:DIR "Src:\data" /s > "Dst:\List.txt"
This will NOT work (missing " - these need to be in pairs).Code:"Src:\data" /s > "Dst:\List.txt
This will NOT work (" to be placed around filename(s) (including the path(s)) only).Code:"Src:\data /s > Dst:\List.txt"
This will NOT work (destination filename contains a space).Code:"Src:\data" /s > Dst:\Data List.txt
This will NOT work (destination path contains a space).Code:"Src:\data" /s > Dst:\Data List\List.txt