Copying a file to multiple folders

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
 
P

Pegasus \(MVP\)

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.
 
V

vincent-nyc

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top