很多小伙伴是十分喜欢Windows10的锁屏壁纸的,但是苦于无法提取出来,那么我们今天提供一下这个方法,方便大家使用

  • 首先,我们需要右键点击开始按钮,选择Powershell(管理员)
  • 弹出Powershell界面以后,我们输入下面内容(复制下面内容,粘贴过去就好)
add-type -AssemblyName System.Drawing
New-Item "$($env:USERPROFILE)\Pictures\Wallpaper" -ItemType directory -Force;
New-Item "$($env:USERPROFILE)\Pictures\Wallpaper\CopyAssets" -ItemType directory -Force;
New-Item "$($env:USERPROFILE)\Pictures\Wallpaper\Horizontal" -ItemType directory -Force;
New-Item "$($env:USERPROFILE)\Pictures\Wallpaper\Vertical" -ItemType directory -Force;
foreach($file in (Get-Item "$($env:LOCALAPPDATA)\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\*"))
{
    if ((Get-Item $file).length -lt 100kb) { continue }
    Copy-Item $file.FullName "$($env:USERPROFILE)\Pictures\Spotlight\CopyAssets\$($file.Name).jpg";
}

foreach($newfile in (Get-Item "$($env:USERPROFILE)\Pictures\Wallpaper\CopyAssets\*"))
{
    $image = New-Object -comObject WIA.ImageFile;
    $image.LoadFile($newfile.FullName);
    if($image.Width.ToString() -eq "1920"){ Move-Item $newfile.FullName "$($env:USERPROFILE)\Pictures\Wallpaper\Horizontal" -Force; }
    elseif($image.Width.ToString() -eq "1080"){ Move-Item $newfile.FullName "$($env:USERPROFILE)\Pictures\Wallpaper\Vertical" -Force; }
}
Remove-Item "$($env:USERPROFILE)\Pictures\Wallpaper\CopyAssets\*";
  • 输入完成后,我们需要按下回车,会显示类似下方内容
>> Remove-Item "$($env:USERPROFILE)\Pictures\Wallpaper\CopyAssets\*";

    目录: C:\Users\Fantasy\Pictures

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       2019/11/28     10:50                Wallpaper

    目录: C:\Users\Fantasy\Pictures\Wallpaper

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       2019/11/28     10:50                CopyAssets
d-----       2019/11/28     10:50                Horizontal
d-----       2019/11/28     10:50                Vertical

经过以上操作以后,我们来找一下获取到的壁纸文件

  • 使用组合键Win+R
  • 输入%userprofile%\Pictures\Wallpaper\按下回车
  • 其中Horizontal横屏壁纸Vertical竖屏壁纸

学会了吗,点个赞呗