Link to home
Start Free TrialLog in
Avatar of Phelms215
Phelms215

asked on

Batch file to copy file

Hello,

I am looking to create a batch file that would copy a file into every folder listed in a particular folder. An example is here

Say I have file text.txt and want it to exist in C:\users\*\folder\  (where the * is each folder in the users directory.

so pretty much I want to run a script that would copy text.txt from the C: directory and place it in C:\users\*\folder\ directory.

If possible I would like the script to also renname any files already in the folder with that name so if a text.txt file exists in one of the user folders it would rename it to text.txtOLD instead.

If someone could point me in the right direction.
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SISAnt
SISAnt

thats quite a complicated thing you're asking for there, But i beleive I know something that might be able to help you.

http://technet.microsoft.com/en-us/library/cc733145(WS.10).aspx

That. is Robocopy, a brilliant command line util included with windows that will do pretty anything you want it to in regards to copying/moving/editing etc.
Avatar of Phelms215

ASKER

Perfect!!
No problem, glad to help :-)