NotepadPlusPlus PRO Asked: 2019-04-06 09:37:43 +0800 CST2019-04-06 09:37:43 +0800 CST 2019-04-06 09:37:43 +0800 CST 将 Windows 背景墙纸更改为锁定屏幕 772 我有 Windows 10 笔记本电脑,我非常喜欢 Windows 偶尔会自动更改的所有锁屏壁纸。是否可以同时使用相同的墙纸更改我的桌面背景? windows-10 desktop desktop-customization 1 个回答 Voted Best Answer music2myear 2019-04-06T10:09:53+08:002019-04-06T10:09:53+08:00 从这里:https ://www.thewindowsclub.com/use-windows-spotlight-desktop-wallpaper-slideshow 将以下内容保存为 Powershell 脚本: $files = gci $Env:LocalAppData\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets | where Length -gt 1kb if ($files) { $shell = New-Object -ComObject Shell.Application #destination for pictures (if doesn't exist, will be created) $folder = "$Env:USERPROFILE\OneDrive\Pictures\Wallpaper\Spotlight" if (!(Test-Path $folder)) { mkdir $folder } $files | % { $_ | Copy-Item -Destination $folder\$_.jpg Get-Item $folder\$_.jpg } | % { $namespace = $shell.namespace($folder) $item = $namespace.ParseName($_.Name) $size = $namespace.GetDetailsOf($item, 31) if ($size -match '(\d+) x (\d+)') { $width = [int]($Matches[1]) $height = [int]($Matches[2]) } if (!$size -or $width -lt 1920 -or $height -lt 500) { Remove-Item $_ } } } 如果您愿意,可以修改该行$folder = "$Env:USERPROFILE\OneDrive\Pictures\Wallpaper\Spotlight"以将文件放在您想要的位置。 将以下内容另存为 .xml 文件: <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Date>2017-11-23T15:57:26.1901555</Date> <Author>SP4\skeene</Author> <Description>Copies files larger than 1kb from "LocalAppData\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets" to "USERPROFILE\OneDrive\Pictures\Wallpaper\Spotlight\", omiting any files with a width less than 1920 or height less than 500 pixels.</Description> <URI>\Shawn Keene\Copy Spotlight Pictures</URI> </RegistrationInfo> <Triggers> <CalendarTrigger> <StartBoundary>2017-11-23T23:55:00</StartBoundary> <Enabled>true</Enabled> <ScheduleByDay> <DaysInterval>1</DaysInterval> </ScheduleByDay> </CalendarTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>S-1-5-21-744251132-1553713446-1048557590-1001</UserId> <LogonType>Password</LogonType> <RunLevel>LeastPrivilege</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <Duration>PT5M</Duration> <WaitTimeout>PT1H</WaitTimeout> <StopOnIdleEnd>false</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>true</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT1H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"</Command> <Arguments>-ExecutionPolicy Bypass -file "C:\Path\To\PowerShel\Script\savespotlight.ps1"</Arguments> </Exec> </Actions> </Task> 如果您修改了 PowerShell 脚本,则需要在 XML 文件中进行匹配更改。此外,您需要更改 Arguments 行以指向您的 Powershell 脚本文件位置:<Arguments>-ExecutionPolicy Bypass -file "C:\Path\To\PowerShel\Script\savespotlight.ps1"</Arguments> 打开 Task Scheduler 并将此 XML 作为计划任务导入。根据需要对设置进行任何调整。设置触发器以每天运行此脚本。 现在打开设置 > 个性化并将背景设置为幻灯片,然后选择您指定为幻灯片图像源文件夹的文件夹。
从这里:https ://www.thewindowsclub.com/use-windows-spotlight-desktop-wallpaper-slideshow
将以下内容保存为 Powershell 脚本:
如果您愿意,可以修改该行
$folder = "$Env:USERPROFILE\OneDrive\Pictures\Wallpaper\Spotlight"
以将文件放在您想要的位置。将以下内容另存为 .xml 文件:
如果您修改了 PowerShell 脚本,则需要在 XML 文件中进行匹配更改。此外,您需要更改 Arguments 行以指向您的 Powershell 脚本文件位置:
<Arguments>-ExecutionPolicy Bypass -file "C:\Path\To\PowerShel\Script\savespotlight.ps1"</Arguments>
打开 Task Scheduler 并将此 XML 作为计划任务导入。根据需要对设置进行任何调整。设置触发器以每天运行此脚本。
现在打开设置 > 个性化并将背景设置为幻灯片,然后选择您指定为幻灯片图像源文件夹的文件夹。