win10如何改变登陆界面背景

来源:互联网 发布:淘宝的标品与非标品 编辑:程序博客网 时间:2024/05/02 11:30

因为win10没有直接可以修改登录背景的UI界面,所以只能修改UI代码.

1.新建一个txt文本,然后复制如下代码进去,其中第三行$replacementPath就是你要替换的背景图路径,可以是绝对也可以是相对,最后把后缀名改成.ps1,名字随便起.

$priPath = "$env:windir\SystemResources\Windows.UI.Logon\Windows.UI.Logon.pri"$outputPath = ".\Windows.UI.Logon.pri"$replacementPath = ".\chuyin.jpg"$inputStream = [System.IO.File]::OpenRead($priPath)$outputStream = [System.IO.File]::Create($outputPath)$replacementStream = [System.IO.File]::OpenRead($replacementPath)$inputReader = New-Object System.IO.BinaryReader -ArgumentList $inputStream$outputWriter = New-Object System.IO.BinaryWriter -ArgumentList $outputStream$inputStream.CopyTo($outputStream)$replacementLengthAligned = ([Math]::Ceiling($replacementStream.Length / 8) * 8)# header$inputStream.Seek(0x14, "Begin") | Out-Null$headerLength = $inputReader.ReadUInt32()$inputStream.Seek(0xB8, "Begin") | Out-Null$dataitemOffset = $inputReader.ReadUInt32()$origDataitemLength = $inputReader.ReadUInt32()$dataitemLength = $origDataitemLength + $replacementLengthAligned$outputStream.Seek(0xBC, "Begin") | Out-Null$outputWriter.Write([int]$dataitemLength)# dataitem$outputStream.Seek($headerLength + $dataitemOffset + 0x18, "Begin") | Out-Null$outputWriter.Write([int]$dataitemLength)$inputStream.Seek($headerLength + $dataitemOffset + 0x24, "Begin") | Out-Null$stringCount = $inputReader.ReadUInt16()$blobCount = $inputReader.ReadUInt16()$origDataLength = $inputReader.ReadUInt32()$outputStream.Seek(0xC, "Current") | Out-Null$outputWriter.Write([int]($origDataLength + $replacementLengthAligned))$outputStream.Seek($stringCount * 4, "Current") | Out-Nullfor ($i = 0; $i -lt 10; $i++){    $outputWriter.Write($origDataLength)    $outputWriter.Write([int]$replacementStream.Length)}$outputStream.Seek(($blobCount - 10) * 8, "Current") | Out-Null# data$outputStream.Seek($origDataLength, "Current") | Out-Nullif ($outputStream.Length - $outputStream.Position -ne 0x18){    Write-Error "Not compatible with this PRI file."}$replacementStream.CopyTo($outputStream)# footer$outputStream.Seek($replacementLengthAligned - $replacementStream.Length, "Current") | Out-Null$outputWriter.Write(0xDEF5FADE)$outputWriter.Write([int]$dataitemLength)$outputWriter.Write(0xDEFFFADE)$outputWriter.Write(0x00000000)$outputWriter.Write([char[]]"mrm_pri2")$outputStream.Seek(0xC, "Begin") | Out-Null$outputWriter.Write([int]$outputStream.Length)$outputStream.Seek(-0xC, "End") | Out-Null$outputWriter.Write([int]$outputStream.Length)$inputReader.Close()$outputWriter.Close()$replacementStream.Close()

改完后如图:

2.右键单击login,选择使用PowerShell运行
如图:

运行后会生成一个一个.pri格式的文件,如图:

然后复制到C:\Windows\SystemResources\Windows.UI.Logon目录下,替换同名文件即可。注意,最好备份一下那个文件,省得出什么问题。

这里要注意的是必须先获取到Windows.UI.Logon文件夹的权限才能替换文件。

替换成功后,win+L打开登陆界面即可看到更换后的壁纸。

如图:

0 0