自分の質問に答えてしまいました...
@echo off
setlocal EnableExtensions EnableDelayedExpansion
::set max 7z archive -- 200MB = 209,715,200
set MaxBag=210000000
echo ******************************************************************************************
echo 'PruneNBag.cmd' uses the current path it is placed in as the cleanup point, called 'TreeTop'
echo All files in all subfolder(s) below the TreeTop will be condensed into 7z archives.
echo ******************************************************************************************
:Ask
::Confirm current working directory is the intended 'TreeTop'
echo Current Directory is: "%CD%" Use as 'TreeTop'? (Y/N/exit)
set INPUT=
set /P INPUT=Type input: %=%
If /I "%INPUT%"=="y" goto yes
If /I "%INPUT%"=="n" goto no
If /I "%INPUT%"=="exit" goto exit
echo Incorrect Input & goto Ask
:yes
set treetop=%CD%
echo Pruning current directory, %treetop%
"%PROGRAMFILES%\7-Zip\7z.exe" h * "!Bag!" "%treetop%\%%a\%%b"
ping 1.1.1.1 -n 1 -w 3000>nul
FOR /f %%a in ('dir /b /ad %treetop%') DO (
set BagCounter=1
FOR /f %%b in ('dir /b %treetop%\%%a') DO (
set Bag=%treetop%\%%a\%%a-!BagCounter!.7z
"%PROGRAMFILES%\7-Zip\7z.exe" a -mx0 "!Bag!" "%treetop%\%%a\%%b" -sdel
FOR /F "usebackq" %%A IN ('!Bag!') DO (
set BagSize=%%~zA
echo bagsize is !BagSize!
echo maxbag is !MaxBag!
if !BagSize! GEQ !MaxBag! set /a BagCounter += 1
echo BagCount is !BagCounter!
)
)
)
echo Pruning operations complete...
ping 1.1.1.1 -n 1 -w 2000>nul
goto end
:no
echo Place PruneNBag.cmd in 'TreeTop' folder root and run again.
pause
echo closing...
ping 1.1.1.1 -n 1 -w 2000>nul
exit
:end
echo closing...
ping 1.1.1.1 -n 2 -w 2000>nul
exit
Get-ChildItem
ます。