无法删除 %WinDir%\System32\OOBE\Info\Backgrounds

无法删除 %WinDir%\System32\OOBE\Info\Backgrounds

我有一个 PS 脚本(通过 SCCM 部署),需要删除 %windir%\System32\OOBE\Info\Backgrounds 中的项目,但它完全拒绝这样做。

如果我手动执行,它会完美运行。但如果由系统执行,它会设置权限,但永远不会删除文件。

& takeown /f "C:\Windows\System32\oobe\info\backgrounds" /a /r /d y
& icacls "C:\Windows\System32\oobe\info\backgrounds" /grant administrators:F /t /c
& del /q /f "C:\Windows\System32\oobe\info\backgrounds\*"

对此有什么想法吗?

相关内容