Help with batch file setting compatibility for all exe files in a dir

So this should be easy, but I can’t get it to execute in a bat or action language through BF. I’m trying change the compatibility mode all EXE files in a specific directory.

for %x in (“c:\progs*.exe”) do reg.exe Add “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers” /v “%~fx” /d “WINXPSP3” /f

works just fine in the command prompt

Thanks for any guidance, appreciate it.

The first step would definitely be to get it working in batch first.

If this works from a command line, outside of a batch, the first thing that jumps out at me is that in a batch, the %x in the for statement has to be escaped, as in

for %%x in ("c:\progs*.exe") do reg.exe Add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%~fx" /d "WINXPSP3" /f

edit: fixed smart quotes

I’ll give it a shot and follow up; tyvm

Still throwing an exit code; I did a reg export from another box and just used the reg wizard, done deal. thanks again