We help IT Professionals succeed at work.
Get Started

Find and copy files script

iris01
iris01 asked
on
451 Views
Last Modified: 2012-05-12
I currently have need to create a script to find all files of certain types (i.e doc, xls, pdf, etc) on a users hard drive and move them into their "my documents" folder, this is as part of an upcoming desktop image refresh.

Ideally the script will also write a line to a log file in a central location just specifying how big the folder is after the file copy.

I've been through everything I can find on the subject, but haven't been able to find a script I can make work for my purposes, note I am not a scripter, I generally just butcher other scripts to fit my needs so please bare this in mind when answering!

I believe my biggest issue is cyclic copying, in that the target folder is a child of the source folder which obviously introduces a loop (and an error when running vbscripts or batch files!)

Please note, I can't use any third party tool to perform this, as it needs to be as easy to roll out as possible.

Thanks in advance.
Comment
Watch Question
Test your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE