Recommended Posts

I have a gpo for cleaning up the context menu on all my clients from all the extentions installed by software (im a little ocd when it comes to these useless extentions) This works great for everything bar windows media player.

Normally i use group policy preferences but the context menu items for windows media player seem to be stored on diffierent locations on different versions of windows so im using powershell to find the key.


New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
$MUIPath = Get-ChildItem "HKCR:\Local Settings\MuiCache" | Where-Object {$_.PSChildName -ne '52C64B7E'}
$MUIPath.PSPath += "\52C64B7E"
Set-ItemProperty $MUIPath.PSPath "@C:\Windows\system32\unregmp2.exe,-9800" "&Add to Playlist"
Set-ItemProperty $MUIPath.PSPath "@C:\Windows\system32\unregmp2.exe,-9801" "&Play"
Set-ItemProperty $MUIPath.PSPath "@C:\Windows\system32\unregmp2.exe,-9991" "&Play"
Pop-Location
[/CODE]

Which changes the menu for media files (ill kill the redundant "play" item later)

EAg7DXq.png

The issue im having with this script is that it only works when i run it manually. I have tried creating a scheduled task to run it under system and a full domain admin account with no luck it simply runs forever. Adding it as a powershell login script in the gpo didnt work either.

Id just unregister them but the add to playlist is a useful function. The script is signed and it showed no issue in the powershell debugger.

Any ideas for what the issue might be from powershell gurus ?

Link to comment
https://www.neowin.net/forum/topic/1135238-powershell-script-not-running/
Share on other sites

  • 1 month later...
  • 2 weeks later...
This topic is now closed to further replies.
  • Posts

    • I gave up on browser ad-blocking extensions a few years ago, replaced them with Adguard. Not perfect but overhaul is a nice app that does the job on both Windows and Android with the respective versions.
    • Glary Utilities 6.43.0.47 by Razvan Serea Glary Utilities offers numerous powerful and easy-to-use system tools and utilities to fix, speed up, maintain and protect your PC. Glary Utilities allow you to clean common system junk files, as well as invalid registry entries and Internet traces. You can manage and delete browser add-ons, analyze disk space usage and find duplicate files. You can also view and manage installed shell extensions, encrypt your files from unauthorized access and use, split large files into smaller manageable files and then rejoin them. Furthermore, Glary Utilities includes the options to find, fix, or remove broken Windows shortcuts, manage the programs that start at Windows startup and uninstall software. All Glary Utilities tools can be accessed through an eye-pleasing and totally simplistic interface. Glary Utilities 6.43.0.47 changelog: Optimized Memory Defrager: Optimized the clipboard cleaning algorithm, increasing speed by 5%. Optimized Wipe Free Space: Optimized the free space wiping algorithm, increasing speed by 8%. Minor GUI improvements. Minor bug fixes. Download: Glary Utilities 6.43.0.47 | 27.0 MB (Freeware) Download: Portable Glary Utilities | 32.3 MB View: Glary Utilities Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • "Of course the easiest solution is to switch to uBlock Origin Lite if you want to remain on Chrome, as it is MV3-based, but from our experience, uBO Lite does not seem to be as good as the original non-Lite version" In my experience uBlock Origin Lite does the job for normal everday home users. When they kill that we get to watch Firefox and Brave get a boost in user market share.
    • Block by DNS ad blocker! I dare you! I will even layer unlock Origin, on top of my internal DNS, if I need to and I don’t even block ads today (I really should but this type of behavior makes me angry). I suppose I could also just be lazy, and add the flags myself, back to each release (it wouldn’t be that difficult).
    • Wonder what MPs have ties to these privacy/verification/data harvesting companies that are going to step in this time. Last time under the Tories half the cabinet had fingers in the pies, heck even the PM and his wife at the time was working for silicon valley, probably made a fortune.
  • Recent Achievements

    • Week One Done
      skylerssviv earned a badge
      Week One Done
    • One Month Later
      mobmobiles earned a badge
      One Month Later
    • Very Popular
      Captain_Eric earned a badge
      Very Popular
    • One Month Later
      amusc earned a badge
      One Month Later
    • One Month Later
      DJC50PLUS earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      497
    2. 2
      PsYcHoKiLLa
      216
    3. 3
      ATLien_0
      92
    4. 4
      +Edouard
      90
    5. 5
      Steven P.
      82
  • Tell a friend

    Love Neowin? Tell a friend!