copy to desire folders as from text references
Posted: 05 Apr 2010 09:44
HI dostips Batch Scripter Experts!!
urgently need a script that can read files from the reference text document &
copy the files from a folder through subfolders to the desire folder according to their filetype and will display message when done copying!!
for example, in my c: drive
c:\source\temp\fizzy moon.bmp
c:\source\temp\documents\jan_reports.doc
c:\source\temp\album\malesinger\usher 01.mp3
ref.txt
-----------------content-------------
fizzy moon
jan_reports
usher 01
---------------content end-----------
d:\destination\pictures\fizzy moon.bmp
d:\destination\work\jan_reports.doc
d:\destination\favourite\album\usher 01.mp3
Can bat scripts determine the filetype while getting all the filenames
from the ref.txt(in desktop) & copy them to their desire folders??
if possible, show a message displaying the copy process is done!!
thanks in advance, below is the script i done but it is not working...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
cd /d "%USERPROFILE%\DESKTOP\"
for /f "usebackq delims=" %%a in ('findstr /I /X /g:ref.txt') do xcopy %%~a *.bmp "d:\destination\pictures\"
for /f "usebackq delims=" %%b in ('findstr /I /X /g:ref.txt') do xcopy %%~b *.doc "d:\destination\work\"
for /f "usebackq delims=" %%c in ('findstr /I /X /g:ref.txt') do xcopy %%~c *.mp3 "d:\destination\favourite\album\"
dir /s /b "d:\destination\"*.*>list.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
really need some guides here, why isn't it working?!?
urgently need a script that can read files from the reference text document &
copy the files from a folder through subfolders to the desire folder according to their filetype and will display message when done copying!!
for example, in my c: drive
c:\source\temp\fizzy moon.bmp
c:\source\temp\documents\jan_reports.doc
c:\source\temp\album\malesinger\usher 01.mp3
ref.txt
-----------------content-------------
fizzy moon
jan_reports
usher 01
---------------content end-----------
d:\destination\pictures\fizzy moon.bmp
d:\destination\work\jan_reports.doc
d:\destination\favourite\album\usher 01.mp3
Can bat scripts determine the filetype while getting all the filenames
from the ref.txt(in desktop) & copy them to their desire folders??
if possible, show a message displaying the copy process is done!!
thanks in advance, below is the script i done but it is not working...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
cd /d "%USERPROFILE%\DESKTOP\"
for /f "usebackq delims=" %%a in ('findstr /I /X /g:ref.txt') do xcopy %%~a *.bmp "d:\destination\pictures\"
for /f "usebackq delims=" %%b in ('findstr /I /X /g:ref.txt') do xcopy %%~b *.doc "d:\destination\work\"
for /f "usebackq delims=" %%c in ('findstr /I /X /g:ref.txt') do xcopy %%~c *.mp3 "d:\destination\favourite\album\"
dir /s /b "d:\destination\"*.*>list.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
really need some guides here, why isn't it working?!?