CODE: [Copy to clipboard]
@echo on&setlocal EnableDelayedExpansion
title 按照星期或指定节日自动更改壁纸---P处理---by 彬(QQ:43142691) %date%
::提示 在路径下 必须要有 “节日壁纸 随机壁纸 星期壁纸” 这3个文件夹
::****************************************************************************
set 服务器路径=c:\2
set 时间服务器=192.168.0.253
::****************************************************************************
set y=%date:~0,-10%
set d=%date:~8,-4%
set 周=%date:~-3%
set 月=%date:~5,-7%
set 日=%date:~8,-3%
set 今天日期=today.ini
set n=0
:显示
::***********************************************************************
echo %月%%日% %周%>%今天日期%
find "①=不排除" %服务器路径%\配置文件.ini && goto 初始化
find "%computername%" %服务器路径%\配置文件.ini && goto 初始化
exit
:初始化
find "②=不随机" %服务器路径%\配置文件.ini && goto 跳过随机
set /a x=%random%%%100+1
set 壁纸文件名=跳过随机壁纸\%x%
goto 更换壁纸
:跳过随机
set /a n+=1
set 星期=壁纸文件名=星期壁纸
set 节日=壁纸文件名=节日壁纸
for /f "tokens=2" %%F in (%今天日期%) do set %星期%\%%F
find "③=不启用" %服务器路径%\配置文件.ini && goto 更换壁纸
for /f "tokens=1" %%i in (%今天日期%) do set %节日%\%%i
:更换壁纸
if %n% EQU 3 goto 完成
if not exist %服务器路径%\%壁纸文件名%.bmp goto 跳过随机
set regadd=reg add "HKCU\Control Panel\Desktop
%regadd%" /v TileWallpaper /d "0" /f
%regadd%" /v Wallpaper /d "%服务器路径%\%壁纸文件名%.bmp" /f
%regadd%" /v WallpaperStyle /d "2" /f
gpupdate /force
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
del %今天日期%
exit
下面是 配置文件.ini