Guest vincent-nyc Posted October 15, 2008 Posted October 15, 2008 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
Guest Pegasus \(MVP\) Posted October 15, 2008 Posted October 15, 2008 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 October 16, 2008 Posted October 16, 2008 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. > > > >
Recommended Posts