
我想根據一年中的月份使用特定的圖像檔案作為我的機器上的背景。例如,如果我有圖像檔案:January.png February.png March.png
然後我希望 January.png 成為我一月份的背景,February.png 成為我二月份的背景,依此類推。理想情況下,我想在 Windows 10 上進行一些設置,以便自動設置當月的圖像。
我知道 Windows 10 本身支援將投影片設定為背景,但它提供的最長刷新週期是一天,而我需要一個月(這不是單一一致的時間量)。
是否可以在不實施任何第三方軟體的情況下完成此操作?
答案1
這將獲取數字中的月份值MM
,並根據月份 12 = 12 月,在後台路徑中套用後台並新增至註冊表。將其複製到記事本文檔中,另存為 .ps1,然後您可以使用任務計劃程序每天或每月運行一次或其他。
$month = get-date -format "MM"
if ($month == 01) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background01.jpg /f }
if ($month == 02) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background02.jpg /f }
if ($month == 03) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background03.jpg /f }
if ($month == 04) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background04.jpg /f }
if ($month == 05) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background05.jpg /f }
if ($month == 06) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background06.jpg /f }
if ($month == 07) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background07.jpg /f }
if ($month == 08) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background08.jpg /f }
if ($month == 09) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background09.jpg /f }
if ($month == 10) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background10.jpg /f }
if ($month == 11) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background11.jpg /f }
if ($month == 12) { reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\background12.jpg /f }