[windows]windows 10 锁屏壁纸保存方法
生活随笔
收集整理的這篇文章主要介紹了
[windows]windows 10 锁屏壁纸保存方法
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
windows 鎖屏壁紙功能叫做spotlight,其實壁紙都下載在本地電腦上,只需要拷貝出來就行了。
腳本
保存為 spotlight.ps1 ,使用右鍵powershell運行
在個人文件夾的Pictures下有兩個Horizontal和Vertical保存著圖片
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; 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; } } Remove-Item "$($env:USERPROFILE)\Pictures\Spotlight\CopyAssets\*"; 復(fù)制代碼必應(yīng)繽紛桌面
微軟出品必應(yīng)繽紛桌面
收集必應(yīng)壁紙的網(wǎng)站
轉(zhuǎn)載于:https://juejin.im/post/5d00a311f265da1bb47d5cd8
總結(jié)
以上是生活随笔為你收集整理的[windows]windows 10 锁屏壁纸保存方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 用设计模式去掉没必要的状态变量 —— 状
- 下一篇: 「原创」猪肚子鸡的做法