windows - REG ADD with spaces within FORFILES command -


I'm trying to automate the app compatibility flag for multiple EXE files that I use. I can get the file command to pull all EXE full paths without any problems. The issue is that information is being given to REG ADD command with space. What am I missing here? I have tried several quotes along with several sets of single quotes but nothing is working properly. What is the right syntax for this command to work? If it is shown below that it is very good if it has to be done in a different way, it is also fine.

Any help would be greatly appreciated.

 SET KEY = "HKLM SOFTWARE \ Microsoft \ Window NT \ CurrentVersion \ AppCompatFlags \ Layers" SET Command = "'REG ADD'"% Key% "/ v @ PATH / T" REG_SZ " / D "RuneSamin" "Forfile / PD: \ & lt; DIR & gt; / S / M * .XA-C with "CMD% Command%"  

Try

  SET "key = HKLM software \ Microsoft \ Windows NT \ CurrentVersion \ AppCompatFlags \ Layers" for / r "d: \ & lt; Dir> "%% a in (" * .exe ") ("% key% "/ t REG_SZ / v" %% ~ fa "/ d Add RUNASADMIN)  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -