Copy .txt files

Score
0
Vote Up
February 6, 2012 at 03:49:00 Pacific
Specs: Windows XP

Im trying to copy text files from a directory to a folder but im not able to do it:pls rectify

@echo off
setlocal
set source=%~dp0\New Folder
set dest=%~dp0
pushd "%source%"
for /f "tokens=*" %%f in (*.txt) do copy %%f "%%a" "%dest%
popd
@echo off & setlocal

New Folder is the place where the txt files are kept and i have to cut the files and paste it in the outer folder


Reply ↓  Report •


#1
Vote Down
Score
0
Vote Up
February 6, 2012 at 05:36:03 Pacific


Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
February 6, 2012 at 06:56:59 Pacific


@echo off & setlocal
set source=%~dp0.\New Folder
set dest=%~dp0
pushd %source%
copy *.txt "%dest%" > nul
popd

Replace copy with move if you want to remove the files from the source folder after they are copied.

Reply ↓  Report •

Reply to Message Icon Start New Discussion
Related Posts

« how to make programme tag... client server multi-threa... »