Copying a file to multiple folders

  • Thread starter Thread starter vincent-nyc
  • Start date Start date
V

vincent-nyc

Hello,

I need to copy a new text file to everyone's Windows directory under
Documents and Settings folder. How would you write a batch file to
accomplish this task?

Thanks,
Vince
 
vincent-nyc said:
Hello,

I need to copy a new text file to everyone's Windows directory under
Documents and Settings folder. How would you write a batch file to
accomplish this task?

Thanks,
Vince

This batch file will perform the basic task:
@echo off
for /d %%a in ("c:\documents and settings\*.*") do xcopy /y c:\test.txt
"%%a\Windows\"

You need to add some extra coding if you want to exclude the various system
profile folders that exist next to the user folders.
 
Hi Pegasus,

can you tell me the extra coding that is needed to only copy the file to the
windows directory in their profile folder?

Thanks.
 
Back
Top