# copy to ALL USER PROFILES



## Swiper (Mar 14, 2003)

Trying to create a batch file (CMD) to copy
a specific file ( call it filename.ext ) to ALL user profiles
Windows 2008 terminal and / or windows 7 or 8 

file needs to go to EVERY individual profile ( in appdata/roaming and appdata/local folders )

can someone help with this ?
i want to run it from my administrator account to all users
i don't want it run by each user to their own profiles 

Thanks alot !!


----------



## foxidrive (Oct 20, 2012)

Do you have write access to every location you wish to write the file to?


----------



## Swiper (Mar 14, 2003)

yes, have admin access for everything necessary !!


----------



## foxidrive (Oct 20, 2012)

Your details are sketchy but test this:


```
@echo off
   for /d %%a in ("c:\users\*") do (
      for %%b in (
         "appdata\roaming\your location A"
         "appdata\roaming\your location B"
         "appdata\roaming\your location C"
         "appdata\roaming\your location D"
         "appdata\roaming\your location E"                                    
         "appdata\local\your location F"         
         "appdata\local\your location G"         
         ) do if exist "%%~a\%%~b\" copy "c:\folder\file.txt" "%%~a\%%~b\"
   )
pause
```


----------

