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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect!!
No problem, glad to help :-)
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.