Forum Discussion

mdomke's avatar
mdomke
Copper Contributor
Aug 24, 2023

Anyone Have a Way To Automate This?

Hi all,

 

I got a really off the wall request from one of our agencies and I'm hoping there's an automated or easier solution then just copying and pasting to every folder. The agency has about 500 Client folders in a SharePoint Document Library. They are asking to have a folder with subfolders inside of it created in each of those 500 folders. Can Power Automate help with this and if so, how? Or is there another way to get this done?

 

Thanks in advance,

  • nimesht's avatar
    nimesht
    Iron Contributor

    Hi mdomke,

     

    If the folder names are fixed then you can automate it with powershell (which I don't know).

    If it's one time, then a quick and dirty solution can be done using excel and DOS commands.

     

    1. map the document library in windows explorer, open with CMD and run the below command to output the current folder list in csv file

     

    dir * /a:d /b > list.csv

     

     

    2. Open the CSV File, Customer Names would appear in column 1. Add header row if required.

    3. add additional columns with the subfolder names required to be created

    4. then add the below formula in B2 to create the create folder DOS command

     

    ="md """&$A2&"\"&B$1&""""

     

     

    5. Select the rest of the fields using "Ctrl + Shift + End"

    6. Fill the rest of the values using "Ctrl + D" and "Ctrl + R", it should appear as below

    7. Copy whole column (1 column at a time, except header). Select B2 and then press "Ctrl + Shift + Down" to select all the values in B column)

    8. Paste the copied data in CMD to create the folders.

    Note: Make sure the double quotes are not missed else it can go haywire.

     

    Use Like if this post helped to solve your issue and Mark as Best Response if the request can be closed.

Resources