Jump to content

Copying a file to multiple folders


Recommended Posts

Guest vincent-nyc
Posted

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

  • Replies 2
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

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.

Guest vincent-nyc
Posted

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.

>

>

>

>


×
×
  • Create New...