copying a file to multiple subdirectories with wildcards

Answered copying a file to multiple subdirectories with wildcards

  • Tuesday, February 26, 2013 9:05 PM
     
     

    I've seen similar but not exact questions.

    I wish to copy a file (c:\pod.bat) to multiple user's roaming profile startup folder. (Z:\ALL FOLDERS HERE\AppData\Roaming\Windows\Start Menu\Porgrams\Startup)

    I've been messing around with a for loop, but the syntax is new to me, and I don't think wildcards can be used in this situation to catch all the directories from "ALL FOLDERS HERE".

    -Thanks, Ryan

All Replies

  • Tuesday, February 26, 2013 9:10 PM
     
     
    have to do it this way due to lack of permissions, which we hope is temporary (6-12 months)
  • Tuesday, February 26, 2013 9:16 PM
     
     Answered

    Yes, wildcards can catch folders in combination with a loop:

    for /d %a in (z:\*.*) do copy /y c:\pod.bat "%a\AppData\Roaming\..."

  • Wednesday, February 27, 2013 3:12 PM
     
     

    A better solution, would be to use a Login Script? - or even copy the file to the ALL Users Startup folder

    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp


    Best Regards
    Claus Codam
    Consultant, Developer
    Coretech - Blog