MENU

利用Powershell提取Win10的windows聚焦图片

July 16, 2018 • Read: 12923 • 教程,资源分享

有时候开机时会被为Windows的聚焦图片所吸引,但是我的电脑几乎不怎么关机...
从这6张图片就能看出来....

win10聚焦锁屏图片一般缓存在
“C:\Users\用户名\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets”
中,这些缓存文件没有后缀名,你只需要重命名加上.jpg就可以看到了

手动多么费劲了
来人 把我的Powershell拿上来
新建一个txt ,复制下面代码进去,后缀名改为.ps1
双击会用记事本打开右击 -> 使用Powershell 运行

图片

# 将复制出来的缓存图片保存在下面的文件夹
add-type -AssemblyName System.Drawing
New-Item "$($env:USERPROFILE)\Pictures\Spotlight" -ItemType directory -Force;
New-Item "$($env:USERPROFILE)\Pictures\Spotlight\CopyAssets" -ItemType directory -Force;
New-Item "$($env:USERPROFILE)\Pictures\Spotlight\Horizontal" -ItemType directory -Force;
New-Item "$($env:USERPROFILE)\Pictures\Spotlight\Vertical" -ItemType directory -Force;
 
# 将横竖图片分别复制到对应的两个文件夹 在\Pictures\Spotlight内
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\Spotlight\CopyAssets\*"))
{
    $image = New-Object -comObject WIA.ImageFile;
    $image.LoadFile($newfile.FullName);
    if($image.Width.ToString() -eq "1920"){ Move-Item $newfile.FullName "$($env:USERPROFILE)\Pictures\Spotlight\Horizontal" -Force; }
    elseif($image.Width.ToString() -eq "1080"){ Move-Item $newfile.FullName "$($env:USERPROFILE)\Pictures\Spotlight\Vertical" -Force; }
}

但是有的人运行后 会黑人问号脸?? 肿么没有???
记得开启这个 Windows聚焦

开启这个

突然想到前几天的事
因为tb小号心不够 我就去买了几十个0.01的壁纸商品
结果就有两家发货 而且其中一家里面就3个图片 打开另一家的链接...10多G的压缩包..
10多G图片 分享出来了 至于质量我就不知道了

Archives QR Code Tip
QR Code for this page
Tipping QR Code
Leave a Comment

9 Comments
  1. 链接没了

  2. 学习了,有点意思!

  3. Ken Ken

    竟然花钱买图片@(滑稽)

    1. Bin Bin

      @Ken因为刷单一个号不够 小号心不够 壁纸0.01一个 买个几十个就够了@(滑稽)

    2. Ken Ken

      @Bin@(滑稽)果然个个都是人才

    3. Bin Bin

      @Ken还不是赚点零花钱#(高兴)

    4. @Bin0.01是啥意思?一分钱?壁纸的质量我等下帮你鉴定下@(捂嘴笑)

    5. Bin Bin

      @小彦对啊 1分钱

    6. Bin Bin

      @小彦可以可以 如果质量高了 可以做个api