I have a folder with +2500 projekt folders like this:
Projekt1
-folder1
-folder2
-folder3
Projekt2
-folder1
-folder2
-folder3
Projekt3
-folder1
-folder2
-folder3
And so on.
I am looking for a PS script to help me copy certain folders and sub folders, to another network share. I am not that good at PS, so I’ve found a script, but it does not include empty folders. And I really need all folders, because every projekt folder is auto generated from a template, so a lot of folders is empty to begin with.
The script looks like this and find the folder named “2_ STXP Tegninger”, then copy it to the set target including the folder structure:
I just googled for something to help me solve the problem. I have a very very limited knowledge about PS.
So this is me learning
I understand what you are writting, but is does not keep the parent folder and the the script can only copy the first folder it finds, the rest just error out with “allready exist”.
Actually that excludes folders at all - not only empty ones. But again - what you’re about to create with your code is actually all build in in robocopy. You don’t have to invent the wheel again. It’s already there.