Computing.Net > Forums > Windows 7 > Copy file1 to file2 in multiple directories

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Copy file1 to file2 in multiple directories

Reply to Message Icon

Name: JrFaust
Date: August 30, 2009 at 13:39:39 Pacific
OS: Windows 7
Product: Microsoft Windows vista ultimate w/ sp1 (full product)
Subcategory: General
Comment:

I would like to automate this process with a batch file.
There is a file for example The_Matrix.mymovies-front.jpg in a movie subdirectory that I want to make a copy of and rename it to mymovies-front.jpg.
I have a directory with many subdirectories.

Like this:
D:\DVD\The Matrix\The_Matrix.mymovies-front.jpg
D:\DVD\True Lies\True_Lies.mymovies-front.jpg
D:\DVD\Underworld\Underworld.mymovies-front.jpg

I hope to end up with this:
D:\DVD\The Matrix\The_Matrix.mymovies-front.jpg
D:\DVD\The Matrix\mymovies-front.jpg

D:\DVD\True Lies\True_Lies.mymovies-front.jpg
D:\DVD\True Lies\mymovies-front.jpg

D:\DVD\Underworld\Underworld.mymovies-front.jpg
D:\DVD\Underworld\mymovies-front.jpg

Thank you for your time,
Robert



Sponsored Link
Ads by Google

Response Number 1
Name: jefro
Date: August 31, 2009 at 12:44:38 Pacific
Reply:

Might look at robocopy.

Playing to the angels
Les Paul (1915-2009)


0

Response Number 2
Name: JrFaust
Date: September 1, 2009 at 14:08:50 Pacific
Reply:

I solved this with a script not using Robocopy.
Robocopy works well to script a copy just not for this scenario.

for /F "tokens=1* delims=&" %i in ('dir /s /b filename') do copy "%i" "%~dpifilename"
This script did what I needed.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 7 Forum Home


Sponsored links

Ads by Google


Results for: Copy file1 to file2 in multiple directories

64bit program want to install in x86 folder?? www.computing.net/answers/windows-7/64bit-program-want-to-install-in-x86-folder/453.html

Programs to run in Win 7 www.computing.net/answers/windows-7/programs-to-run-in-win-7/185.html

Welcome to Windows 7 www.computing.net/answers/windows-7/welcome-to-windows-7/2.html