troubleshooting Question

Scripting the creation of subfolders IF a condition exists

Avatar of Hallidays
Hallidays asked on
PowershellWindows OS
7 Comments1 Solution89 ViewsLast Modified:
Hi all, i know this has been asked a lot but i cannot find anything for my specific scenario. I have a Windows file share with 1,691 folders, these folders contain numerous subfolders. What i want is to scan each top folder and check for subfolders named A, B and C, if these exist, i then want to go into each of them and create a folder called NEW. What i should end up with is

Folder1 > A > 2018
Folder1 > B > 2018
Folder1 > C > 2018

Folder1 may also contain subfolders D, E and F but i don't want anything to happen to these. Also, Folder1 may only contain subfolder B, if that is the case I do want the 2018 folder to be created.

As i said, i have 1691 folders to scan and they could each contain 3 folders that i need to create a subfolder for so all in all a possible 5073 folder creations. I'd rather not do this manually.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros