What would I need to add, to also ignore file names containing AppData with .exe extensions? I am using this in an SetupComplete.cmd for unattended Windows setup, and have AppDataLocal.exe and AppDataRoaming.exe which are sfx archives and do not want these deleted. I am hoping this can be a wildcard, something like AppData*.exe.
forfiles /p "%WINDIR%\Setup\Files" /s /m *.* /c "cmd /c for %G in (@path) do @if /I [%~xG] neq [.reg] @echo del /F /Q %G" /d