0

Here is a screenshot what I'm working with:

screenshot of regedit directory

I wanna run a script that will set every default key in each subdirectory named mplayerc64.*\shell to "enqueue" (no quotes)

2 Answers 2

0

PowerShell:

Get-ChildItem Registry::HKCR\mplayerc64.* -Recurse |
  Where PSChildName -eq 'Shell' |
Set-ItemProperty -Name '(Default)' -Value 'enqueue'  

Aliased:

gci Registry::HKCR\mplayerc64.* -s | ? PSChildName -eq 'Shell' | sp -Name '(Default)' -Value 'enqueue'
5
  • this is exactly what i'm looking for but something's wrong and i don't know how to fix it. i'm not getting an error but the script never ends. i tried both the powershell and aliased versions. i ran each version as a user and admin, and then ran them all over again with a lowercase 'shell' to match the directory string exactly--same result every time, it doesn't finish, and i don't even know where to begin
    – Kyle D
    Commented Aug 2, 2022 at 22:31
  • this works fine. i wrote the question wrong, the directory is actually "mplayerc64*" thank you!
    – Kyle D
    Commented Aug 2, 2022 at 22:35
  • Cool. Thanks for marking my replay as 'Answer'. So no period in the key name, right? For the sake of future readers, I'll edit the question and answer.... Commented Aug 3, 2022 at 1:04
  • no problem. the period is still there i'm just sloppy 😁, your edit is correct
    – Kyle D
    Commented Aug 3, 2022 at 1:14
  • I figured it out after a second look & checking the original screen shot! Commented Aug 3, 2022 at 1:15
0
  1. Export the Registry key and subkeys as one .reg file, e.g., no_def.reg.
  2. Open in the.reg file in a text editor, such as Notepad or Notepad++.
  3. Manually, or by search-and-replace, insert `@="enqueue" after each key.
  4. Check carefully for errors -- a mistake in a Registry entry can cause immense problems.
  5. Save the .reg file under a differe4nt name, enq.reg.

Now you can apply the new .reg file, see if it works as needed, and can revert to the original settings using the first (unmodified) exported file.

N.B. Massive Registry changes can cause issues. Make a disk image, to be safe, before making these changes.

You must log in to answer this question.

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