China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-27 15:43
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Change desktop background View 11,576 Replies 30
Floor 16 Posted 2007-06-17 09:26 ·  中国 广东 广州 黄埔区 电信
中级用户
★★
Credits 326
Posts 152
Joined 2007-05-04 06:16
19-year member
UID 87412
Gender Male
Status Offline
Floor 17 Posted 2007-06-24 12:17 ·  中国 广东 广州 鹏博士宽带
新手上路
Credits 18
Posts 8
Joined 2007-06-24 11:29
19-year member
UID 92223
Gender Male
Status Offline
Originally posted by qq43142691 at 2007-5-4 09:47 AM:
@echo off
title 按星期或指定节日自动更改壁纸---P处理---by 彬(QQ:43142691) 2007-05-04
::
date /t >today.ini

::Start executing...





Where should this batch file be placed
Also, weekly wallpapers
Floor 18 Posted 2007-07-13 23:09 ·  中国 河南 许昌 电信
新手上路
Credits 2
Posts 1
Joined 2007-07-13 22:43
18-year member
UID 93914
Gender Male
Status Offline
: :lol::lol::lol:Thanks
Floor 19 Posted 2007-07-14 22:16 ·  中国 广东 湛江 电信
新手上路
Credits 4
Posts 2
Joined 2007-07-14 14:30
18-year member
UID 93959
Gender Male
Status Offline
That's quite interesting. I was looking for exactly this one
Floor 20 Posted 2007-07-14 22:45 ·  中国 广东 湛江 电信
新手上路
Credits 4
Posts 2
Joined 2007-07-14 14:30
18-year member
UID 93959
Gender Male
Status Offline
Attachment 1: Microsoft-produced "Desktop Wallpaper Auto-Changer".rar

I'm also looking for it!!!
Floor 21 Posted 2007-07-27 14:24 ·  中国 湖北 武汉 电信
新手上路
Credits 2
Posts 1
Joined 2007-06-26 02:24
19-year member
UID 92355
Gender Male
Status Offline
Floor 22 Posted 2007-08-13 10:07 ·  中国 浙江 温州 电信
新手上路
Credits 2
Posts 1
Joined 2007-08-13 00:38
18-year member
UID 95034
Gender Male
Status Offline
Originally posted by sdzztz at 2007-4-29 09:46 AM:
AXzx

Test completed, wallpaper cannot be changed
Floor 23 Posted 2007-08-14 01:37 ·  中国 广东 广州 越秀区 电信
中级用户
★★
Credits 326
Posts 152
Joined 2007-05-04 06:16
19-year member
UID 87412
Gender Male
Status Offline
This is for autoBZ.bat

@echo off&setlocal EnableDelayedExpansion
title Automatically Change Wallpaper According to Day of the Week or Specified Holiday---P Processing---by Bin(QQ:43142691) %date%
::****************************************************************************
set server_path=c:\2
set time_server=10.0.0.247
::****************************************************************************
set y=%date:~0,-10%
set d=%date:~8,-4%
set week=%date:~-3%
set month=%date:~5,-7%
set day=%date:~8,-3%
set today_date=today.ini
set n=0
set hour=%time:~0,2%
set minute=%time:~3,2%
set second=%time:~6,2%
if %hour% GEQ 0 goto midnight
goto afternoon
:midnight
if %hour% GEQ 5 goto morning
set current_period=midnight
goto display
:morning
if %hour% GEQ 10 goto noon
set current_period=morning
goto display
:noon
if %hour% GEQ 14 goto afternoon
set current_period=noon
goto display
:afternoon
if %hour% GEQ 18 goto evening
set current_period=afternoon
goto display
:evening
if %hour% GEQ 0 goto midnight
set current_period=evening
:display
set current_time_is=%current_period%%hour% o'clock %minute% minutes %second% seconds
set today_date_is=%y% year %month% month %d% day %current_time_is%
::***********************************************************************
echo %month%%day% %week%>%today_date%
find "①=不排除" %server_path%\exclude_machines.ini && goto initialization
find "%computername%" %server_path%\configuration_file.ini && goto initialization
exit
:initialization
find "②=不随机" %server_path%\configuration_file.ini && goto skip_random
set /a x=%random%%%100+1
set wallpaper_file_name=skip_random_wallpaper\%x%
goto change_wallpaper
:skip_random
set /a n+=1
set week_wallpaper_file_name=week_wallpaper
set holiday_wallpaper_file_name=holiday_wallpaper
for /f "tokens=2" %%F in (%today_date%) do set %week_wallpaper_file_name%\%%F
find "③=不启用" %server_path%\configuration_file.ini && goto change_wallpaper
for /f "tokens=1" %%i in (%today_date%) do set %holiday_wallpaper_file_name%\%%i
:change_wallpaper
if %n% EQU 3 goto complete
if not exist %server_path%\%wallpaper_file_name%.bmp goto skip_random
set regadd=reg add "HKCU\Control Panel\Desktop
%regadd%" /v TileWallpaper /d "0" /f
%regadd%" /v Wallpaper /d "%server_path%\%wallpaper_file_name%.bmp" /f
%regadd%" /v WallpaperStyle /d "2" /f
gpupdate /force
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
del %today_date%
find "④=不提示" %server_path%\configuration_file.ini && goto complete
set program_name=systempp.exe
set system_address=%windir%\system32\
set information_stay_time=12

find "%computername%" %server_path%\configuration_file.ini>%system_address%\local_features.ini
for /f "skip=2 tokens=2" %%k in (%system_address%\local_features.ini) do set area=%%k
goto %area%
:main_battle_area
set area=main_battle_area
goto complete_area
:game_area
set area=game_area
goto complete_area
:video_area
set area=video_area
goto complete_area
:leisure_area
set area=leisure_area
goto complete_area
:card_area
set area=card_area
:complete_area
for /f %%a in ("%time:~0,-9%") do set current_time=%%a
if %current_time% GEQ %information_stay_time% goto 3_yuan else
goto 2_yuan
exit
::******************************************************
:2_yuan
if %area% NEQ card_area goto not_expensive
set cost=3_yuan
goto start_bubble
:not_expensive
set cost=2_yuan
goto start_bubble
::******************************************************
:3_yuan
if %area% NEQ card_area goto not_expensive_
set cost=3.5_yuan
goto start_bubble
:not_expensive_
set cost=3_yuan
::******************************************************
:start_bubble
set xy=%area%%computername%
set title=%today_date_is% Welcome to XXX Internet Cafe
set prompt_content=You are client machine , currently charging:%cost%/hour
set icon_type=3
if exist %system_address%\%program_name% del %system_address%\%program_name%
copy %server_path%\%program_name% %system_address%\
start %system_address%\%program_name% ;%system_address%\ie.ico;;%title%;;%prompt_content%;;%icon_type%;;%information_stay_time%;
:complete
net time \\%time_server% /set /y
net use * /del /y
exit

The following is configuration_file.ini

This is the server-side configuration file, please place it on the server side
*****************************************************************
【Here set whether to specify the computer to execute the following program】 Keywords
①=Do not exclude
*****************************************************************
【Here set whether to random】 Keywords
Whether to display special holidays
②=Do not random
*****************************************************************
【Here set whether to enable special holidays】 Keywords
Whether to display special holidays
③=Do not enable
*****************************************************************
【Here set whether to enable special holidays】 Keywords
Whether to display special holidays
④=Do not prompt
*****************************************************************
The following are the computer names that specify the computer to change the wallpaper
*****************************************************************
Computer name Area number
A001 Main battle area
A002 Main battle area
A003 Main battle area
A004 Main battle area
A005 Main battle area
A006 Main battle area
A007 Main battle area
A008 Main battle area
A009 Main battle area
A010 Main battle area
Attachments
QQ截图未命名.jpg
Floor 24 Posted 2008-02-03 00:30 ·  中国 广东 惠州 电信
新手上路
Credits 2
Posts 1
Joined 2008-02-03 00:05
18-year member
UID 110082
Gender Male
Status Offline
:P:P:P:P:P:P:P:P:P:P:P

Top top top top top top top top top top top top top top top top top top top top top top top top top top top top top top top top top
Floor 25 Posted 2008-02-07 14:24 ·  中国 江西 上饶 电信
新手上路
Credits 4
Posts 2
Joined 2008-01-29 20:21
18-year member
UID 109799
Gender Male
Status Offline
@echo off
color 0a
title Changing Desktop
echo Adding registry items...
set regadd=reg add "HKEY_CURRENT_USER\Control Panel\Desktop
%regadd%" /v TileWallpaper /d "0" /f
%regadd%" /v Wallpaper /d "C:\WINDOWS\Web\Wallpaper\Windows Server 2003.bmp" /f
%regadd%" /v WallpaperStyle /d "2" /f
echo Changing desktop background
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters

PS: Replace "C:\WINDOWS\Web\Wallpaper\Windows Server 2003.bmp" with your file~ Must be in BMP format
Floor 26 Posted 2008-03-23 19:06 ·  中国 山西 太原 联通
初级用户
Credits 23
Posts 17
Joined 2006-04-30 19:15
20-year member
UID 54737
Gender Male
Status Offline
The settings are too complicated.

It's better to use a third-party software to implement this thing.
Floor 27 Posted 2008-03-24 11:27 ·  中国 河南 洛阳 电信
新手上路
Credits 16
Posts 7
Joined 2008-02-19 16:19
18-year member
UID 110977
Gender Male
Status Offline
::///////////////////////////////////Desktop

rem Set server image path [folder for BMP images], only BMP format is supported [if the number exceeds 1000, the extra images will not be read by this script]
set 图片路径=\\cgo\pic$\1024768

rem Set the path of the local image when the network is unavailable [full path of a single BMP image]
set 本地图片=E:\General Tools\web\Civilized City.bmp

dir/b/s "%图片路径%\*.bmp" |find /i /n ".bmp" >"bmp.txt"
for %%i in (bmp.txt) do if %%~zi EQU 0 goto 更换
for /f "delims=[]" %%i in (bmp.txt) do @set Num1=%%i
if %Num1% LSS 10 (Set Num3=1) Else (if %Num1% LSS 100 (Set Num3=2) Else Set Num3=3)
:GetRandom
call set Num2=%%random:~-%Num3%%%
if %Num2% GTR %Num1% goto GetRandom
for /f "tokens=* delims=0" %%i in ("%Num2%") do set Num2=%%i
if "%Num2%" EQU "" set Num2=%Num1%
set bmppath=
for /f "tokens=1* delims=[]" %%i in (bmp.txt) do @if /i %%i==%Num2% set bmppath=%%j
del bmp.txt
:更换
if exist "%bmppath%" copy "%bmppath%" /y "%本地图片%"
if exist "%本地图片%" (set bmppath=%本地图片%) else exit
@reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v TileWallpaper /d "0" /f>nul
@reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /d "%bmppath%" /f>nul
@reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /d "2" /f>nul
@reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /d "%bmppath%" /f>nul
@reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ListviewShadow /d "1" /f>nul
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
set bmppath=
gpupdate /force

exit

Try this, but I don't know how to set the server path. It says it needs a shared folder, but it didn't work after several tries

If this can't connect to the server, it can take the local image as the desktop background
Floor 28 Posted 2008-04-08 09:42 ·  中国 广东 惠州 电信
新手上路
Credits 8
Posts 4
Joined 2005-11-16 22:58
20-year member
UID 45378
Gender Male
Status Offline
That's amazing, this can be done with batch processing. A master at work, truly extraordinary.
Floor 29 Posted 2008-04-08 10:27 ·  中国 上海 上海乾万网络(QianWan_Network)有限公司(电信出口)
中级用户
★★
我是DOS学者
Credits 367
Posts 180
Joined 2006-05-14 10:53
20-year member
UID 55507
Gender Male
From 重庆
Status Offline
Using VBS seems more intelligent~~~
Floor 30 Posted 2008-04-08 13:16 ·  中国 浙江 嘉兴 平湖市 电信
初级用户
★★
Credits 157
Posts 67
Joined 2007-05-13 11:03
19-year member
UID 88378
Gender Male
Status Offline
I do need wallpapers from Monday to Sunday.
Forum Jump: