Copying a file to multiple folders

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

vincent-nyc

Guest
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
 
Re: Copying a file to multiple folders


"vincent-nyc" <vincentnyc@discussions.microsoft.com> wrote in message
news:0F52AAAA-8802-4E0F-8089-1F6861EF674B@microsoft.com...
> 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.
 
Re: Copying a file to multiple 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.



"Pegasus (MVP)" wrote:

>
> "vincent-nyc" <vincentnyc@discussions.microsoft.com> wrote in message
> news:0F52AAAA-8802-4E0F-8089-1F6861EF674B@microsoft.com...
> > 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.
>
>
>
>
 
Back
Top