<This post has now been solved>
Hi,
Sorry if this is not the place but does anyone know how to do the following?
I am trying to create a batch file to search a directory for a specified file type and list it in a text file then get the batch file to read that text file and copy all the files it found to a directory.
i have created the following which does work... the problem is, when there is a space in the filename it says it cant find the file, i don't know how to get it to include spaces i would normally by using " ??
Any help will be greatly appreciated.
Hi,
Sorry if this is not the place but does anyone know how to do the following?
I am trying to create a batch file to search a directory for a specified file type and list it in a text file then get the batch file to read that text file and copy all the files it found to a directory.
i have created the following which does work... the problem is, when there is a space in the filename it says it cant find the file, i don't know how to get it to include spaces i would normally by using " ??

Code:
dir /s /b c:\source\*.txt >c:\files2copy.txt
for /f %%i in (c:\files2copy.txt) do xcopy %%i %%j %%k c:\dest
Any help will be greatly appreciated.
Last edited:
My Computer
- Computer type
- PC/Desktop
- Computer Manufacturer/Model Number
- Self Built
- OS
- Windows 8.1 Pro x64
- CPU
- Intel Core i5-2500K @ 3.30GHz - S1155
- Motherboard
- Asus P8P67 LE Rev3, Intel P67, S115
- Memory
- 8GB Corsair DDR3 XMS3, PC3-12800
- Graphics Card(s)
- NVIDIA GeForce GTX 650
- Sound Card
- On-Board
- Monitor(s) Displays
- 3 x 24" {Extended Display}
- Screen Resolution
- 1920 x 1080
- Hard Drives
- 300GB Seagate Barracuda 7200
- PSU
- 550W Coolermaster GX550
- Case
- Silverstone Precision PS04B
- Cooling
- Stock
- Keyboard
- Logitech K120
- Mouse
- World of Warcraft Cataclysm MMO Gaming Mouse
- Internet Speed
- 80 MB
- Antivirus
- MSE / Windows Defender
- Browser
- Chrome