I want to copy iTunesPrefs.xml file for all the users, who have ever logged on to the PC, under the above mentioned location (for iTunes installation). If I run the batch file as a current user, I can only write to my AppData Folder. Also, if I do copy the file to "Default" User; only the new staff who are logging in will get the required settings. I have a system account, which can log onto all the User folders. So, I want it to be copied across all the currently existing profiles. For e.g for following users:
Something like this would work. Assuming you have admin rights to the other user folders. Its very down and dirty, and will throw an error if the appdata\local\
directory does not exist.
When you run this in the C:\users\
directory, it attempts to do a copy on every profile in the C:\users\ directory
.
FOR /d %G in ("*") DO copy C:\temp\iTunesPrefs.xml C:\users\%G\appdata\local\