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-08-08 22:58
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] Wallpaper Auto-Changer Batch Version View 2,341 Replies 4
Original Poster Posted 2008-05-28 13:20 ·  中国 重庆 联通
中级用户
★★
Credits 363
Posts 162
Joined 2007-04-22 21:31
19-year member
UID 86104
Gender Male
Status Offline
Supports JPG and BMP image formats, supports automatic timed replacement and manual (desktop shortcut) opening for replacement.

Download here: http://upload.cn-dos.net/img/480.rar
Floor 2 Posted 2008-05-28 15:24 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Without permission, posting the original code of the owner, please forgive:


@echo off

color 0a
title Automatic Wallpaper Changer
echo.&echo Automatic Wallpaper Changer by:clamber QQ:282959030 CMD@XP 2008/05/27
echo ────────────────────────────────────


net start | find /i "Scheduler" >nul 2>nul
If %Errorlevel% GTR 0 sc config schedule start= auto >nul 2>nul&&net start sched
ule >nul 2>nul
if not exist "%ProgramFiles%\autowallpaper" mkdir "%ProgramFiles%\autowallpaper"
>nul 2>nul
if not exist wiaaut.dll echo.&echo Missing "wiaaut.dll", the program may not be available, still continue please press any key.&pause>nul
move/y wiaaut.dll %windir%\wiaaut.dll>nul 2>nul
regsvr32 /s %windir%\wiaaut.dll>nul

echo.
echo Please enter the path of the folder for automatic wallpaper change, you can directly drag and drop the wallpaper folder. To uninstall, enter
:first
echo.&set/p picpath= -^>
if "%picpath:~3,1%"=="\" set picpath=%picpath:~1,-1%
if /i "%picpath%"=="u" (
regsvr32 /u /s wiaaut.dll
del/q/f %windir%\wiaaut.dll>nul 2>nul
rd/s/q "%ProgramFiles%\autowallpaper">nul 2>nul
schtasks /delete /tn "wallpaper" /f >nul 2>nul
del/q/f "%USERPROFILE%\Desktop\Change Wallpaper.url">nul 2>nul
echo Automatic wallpaper change has been uninstalled! Press any key to exit...&pause>nul&exit
) else (
if not exist "%picpath%" echo Path error!&goto first
)

if not exist "%picpath%\*.jpg" if not exist "%picpath%\*.bmp" echo No image files!&goto first

echo.&echo Value range: minutes, is only to change wallpaper at startup. &echo.
set/p settimes= Please set the wallpaper change cycle (default is 0^):
set/a jtime=1439-%settimes%

if %jtime% EQU 1439 (
schtasks /delete /tn "wallpaper" /f>nul 2>nul
schtasks /create /sc onstart /tn "wallpaper" /ru system /tr """"C:\Program Fi
les\autowallpaper\wallpaper.bat"""">nul 2>nul
) else (
schtasks /delete /tn "wallpaper" /f>nul 2>nul
schtasks /create /sc minute /mo %settimes% /st 00:00:30 /tn "wallpaper" /ru s
ystem /tr """"C:\Program Files\autowallpaper\wallpaper.bat"""">nul 2>nul
)

::Create shortcut
if not exist "%USERPROFILE%\Desktop\Change Wallpaper.url" (
>"%USERPROFILE%\Desktop\Change Wallpaper.url" echo
>>"%USERPROFILE%\Desktop\Change Wallpaper.url" echo URL="%ProgramFiles%\autowallpaper\wallp
aper.bat"
>>"%USERPROFILE%\Desktop\Change Wallpaper.url" echo IconIndex=130
>>"%USERPROFILE%\Desktop\Change Wallpaper.url" echo IconFile=%windir%\system32\SHELL32.dll
>>"%USERPROFILE%\Desktop\Change Wallpaper.url" echo Modified=F00BA4B792A0C80151
attrib +r "%USERPROFILE%\Desktop\Change Wallpaper.url"
)

(echo ^@echo off
echo title Please wait...
echo mode con lines=3 cols=20
echo echo.^&echo Changing new wallpaper...
echo set cdnj=%%~dp0
echo cd/d "%picpath%"
echo :begin
echo if exist wallpaper.bmp del/q/f wallpaper.bmp
echo for /f "tokens=1 delims=" %%%%i in ^('dir/b/d *.jpg *.bmp'^) do ^(
echo set wallpaper=%%%%i
echo call :huanbz
echo ^)
echo del/q/f "%%cdnj%%wallpaper.ini"
echo goto :begin
echo.
echo :huanbz
echo find /i "%%wallpaper%%" "%%cdnj%%wallpaper.ini"^>nul 2^>nul
echo if ^%%errorlevel^%% EQU 1 (
echo echo %%wallpaper%%^>^>"%%cdnj%%wallpaper.ini"
echo mshta "javascript:var i=new ActiveXObject('WIA.ImageFile');i.LoadFile('%
%wallpaper%%');var x=new ActiveXObject('WIA.ImageProcess');x.Filters.Add('{42A6E
907-1D2F-4b38-AC50-31ADBE2AB3C2}');with(x.Filters(1)){Properties('FormatID').Val
ue='{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}';Properties('Quality').Value=100;}x.A
pply(i).SaveFile('wallpaper.bmp');window.close();"
echo reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v TileWallpaper /d "0
" /f^>nul 2^>nul
echo reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /d "%%cd%
%\wallpaper.bmp" /f^>nul 2^>nul
echo reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /d "
2" /f^>nul 2^>nul
echo RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
echo call :attime
echo exit
echo ^)
echo goto :eof
echo.
echo :attime
echo Set/a hour=%%time:~0,2%%+0
echo Set/a minute=1%%time:~3,2%%-100+1
echo If %%minute%% GEQ 60 Set/a minute=%%minute%%-60 ^& Set/a hour=%%hour%%+1
echo If %%hour%% GEQ 24 Set/a hour=%%hour%%-24
echo at %%hour%%:%%minute%% /interactive RunDll32.exe USER32.DLL,UpdatePerUserSy
stemParameters ^>nul 2^>nul
echo exit)>"%ProgramFiles%\autowallpaper\wallpaper.bat"

echo.&echo Done!&ping -n 3 127.1>nul&exit
批处理之家新域名:www.bathome.net
Floor 3 Posted 2008-05-29 14:17 ·  中国 重庆 奉节县 电信
中级用户
★★
Credits 363
Posts 162
Joined 2007-04-22 21:31
19-year member
UID 86104
Gender Male
Status Offline
Hehe, a DLL file is needed. If you only use this simple batch processing, there may be problems with image conversion.
Floor 4 Posted 2008-07-11 15:34 ·  中国 江西 赣州 电信
银牌会员
★★★★
Credits 2,025
Posts 1,122
Joined 2007-09-05 20:15
18-year member
UID 96653
Gender Male
Status Offline
Is the code encrypted?
Floor 5 Posted 2008-07-11 17:19 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Sweat, didn't the second floor provide the source code?
Forum Jump: