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.