1

I have a single value that I'd like to add to many different keys using a .REG file, and I just want to make sure that the syntax I currently have is correct before I risk running it on my machine.

[HKEY_CLASSES_ROOT\WMP11.AssocFile.MP4\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.m3u\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.MPEG\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.WAX\shell\Enqueue\command]
[HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\Enqueue\command] 
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

Here, I'm wanting to add a key called command with a String value of "DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}" to all five registry keys listed. Would the above syntax work to do this?

1
  • It has been several days since we heard from you. Did you need any additional information? If so, would be glad to chime in. If not, were you going to mark the answer as accepted, or did you prefer to leave it open for additional feedback?
    – Run5k
    Commented Nov 17, 2016 at 4:59

1 Answer 1

1

I believe that you want to add Windows Registry Editor Version 5.00 as the first line of your .reg file, have a blank line, then proceed with each individual HKEY_CLASSES_ROOT entry immediately followed by a separate "DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}" line for each one. Essentially, utilize another blank line followed by the next HKEY_CLASSES_ROOT entry with its own "DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}" line on the subsequent line, etc. In other words, something like the following:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\WMP11.AssocFile.MP4\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.m3u\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.MPEG\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.WAX\shell\Enqueue\command]
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

[HKEY_CLASSES_ROOT\WMP11.AssocFile.WMV\shell\Enqueue\command] 
"DelegateExecute"="{45597c98-80f6-4549-84ff-752cf55e2d29}"

As always, backup the appropriate area of the registry before you make any changes!

4
  • Could you give this in code form? Commented Nov 7, 2016 at 3:40
  • I have updated my answer accordingly.
    – Run5k
    Commented Nov 7, 2016 at 3:45
  • Thanks so much, makes it much easier to visualise. The code itself is pretty much what I already came up with in the initial version of the script I'm working on, and it's what made me ask the question: I was wondering if there was a way to add the same value to different keys without repeating the value each time. I'm sure I've seen it done, I'm not entirely positive how. Commented Nov 7, 2016 at 3:48
  • Always glad to help.
    – Run5k
    Commented Nov 7, 2016 at 3:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .