0

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?

  • 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 Nov 17 '16 at 4:59
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!

  • Could you give this in code form? – Hashim Nov 7 '16 at 3:40
  • I have updated my answer accordingly. – Run5k Nov 7 '16 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. – Hashim Nov 7 '16 at 3:48
  • Always glad to help. – Run5k Nov 7 '16 at 3:49

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.