Created
March 7, 2019 10:37
-
-
Save aloisdg/1c95c8f9c6e13ba0528eed6bb7e485d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: https://www.tekrevue.com/tip/find-windows-spotlight-lock-screen-images-windows-10/ | |
let (</>) path1 path2 = System.IO.Path.Combine (path1, path2) | |
let toJpg x = x + ".jpg" | |
let copyTo dest from = System.IO.File.Copy(from, dest) |> ignore | |
// let assetPath = """.\%LocalAppData%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets""" | |
let localAppData = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) | |
let pathToAssets = localAppData </> """Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets""" | |
let myPictures = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyPictures) | |
let pathToBing = myPictures </> "LockScreenPictures" | |
pathToBing |> System.IO.Directory.CreateDirectory |> ignore | |
System.IO.DirectoryInfo(pathToAssets).GetFiles "*" | |
|> Array.filter (fun x -> x.Length > int64 10000) // |> Array.sortByDescending(fun x -> x.Length) | |
|> Array.iter (fun x -> x.FullName |> copyTo (pathToBing </> (toJpg x.Name))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment