A
A
Artemy2019-04-09 20:27:31
Windows
Artemy, 2019-04-09 20:27:31

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

3 answer(s)
A
Artemy, 2019-04-14
@Artemonim

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"

A
akelsey, 2019-04-09
@akelsey

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'"}
}

Result:
5cacf45c4c134077670745.png

R
rionnagel, 2019-04-11
@rionnagel

For example...
dir /sc:\tutiskat | find /v "folder"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question