Hello @takumi harayama
May be a bit simplistic but I would workaround using a batch file that finds each file in the folders from the starting path C:\Program Files\aaaa\ then a DO to set the firewall rule.
@ setlocal enableextensions @ cd /d "C:\Program Files\aaaa\" for /R %%a in (TARGET.EXE) do ( netsh advfirewall firewall add rule name="Blocked with Batchfile %%a" dir=out program="%%a" action=block )
Hope this helps with your query,
--If the reply is helpful, please Upvote and Accept as answer--