Answer the question
In order to leave comments, you need to log in
What if you need to find folders that don't contain a specific folder?
Folder A exists
It contains folders B1, B2, ... , Bn
Each folder Bn may or may not have a folder C
I want all Bn folder names that do not contain folder C
What is the easiest method to solve this problem in Win10 ?
Bat file, another programming language, or some existing program?
Answer the question
In order to leave comments, you need to log in
Find and write to list.txt:
Find and move to the batch file folder: (later needed)
for /d %%i in (D:\A\*) do if not exist %%i/C move %%i "%~dp0"
Structure:
Powershell:
ForEach ($Folder in Get-ChildItem "G:\Temp\A\")
{
$FolderC = $false
ForEach ($Fld in Get-ChildItem $($Folder.FullName) -Recurse)
{
If ($Fld.Name -eq "C") {$FolderC = $true}
}
if ($FolderC) {Write-Host "$($Folder.FullName) содержит папку 'C'"}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question