![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-03 12:02 |
48,038 topics / 350,123 posts / today 0 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] How to change the desktop background via command line using rundll32.exe. |
| Printable Version 2,284 / 6 |
| Floor1 tghksj | Posted 2006-12-04 19:10 |
| 社区乞丐 Posts 90 Credits -49 | |
|
Subject:
Monitor Module: desk.cpl Command: rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0 Result: Background settings. The above one can't be directly modified... The following is for screen saver, depressed Module: appwiz.cpl Command: rundll32.exe desk.cpl,InstallScreenSaver c:\winnt\system\Flying Windows.scr Result: Install screen saver and display preview property page. For the rundll32.exe call commands that can be found on the network, they only can display a certain operation interface. It has no effect on script automation... Regarding the format of calling .dll functions in command line mode and the information about the way of supporting parameterized calls is not found at all. [ Last edited by tghksj on 2006-12-6 at 02:50 PM ] |
|
| Floor2 redtek | Posted 2006-12-04 21:07 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Brother, you can refer to the content of the following post, which talks about changing the desktop background from the registry, refreshing the desktop, to using third-party tools~ :)
Changing Desktop Background http://www.cn-dos.net/forum/viewthread.php?tid=24982&fpage=1&highlight=%E6%A1%8C%E9%9D%A2 Setting Background Desktop, Creating Shortcuts, Emptying Recycle Bin, Command-line Utilities http://www.cn-dos.net/forum/viewthread.php?tid=23132&fpage=1&highlight=%E6%A1%8C%E9%9D%A2 How to "Refresh Desktop" and Reload "explorer.exe" Using Rundll32? http://www.cn-dos.net/forum/viewthread.php?tid=24465&fpage=1&highlight=%E6%A1%8C%E9%9D%A2 [ Last edited by redtek on 2006-12-4 at 08:08 AM ] |
|
| Floor3 tghksj | Posted 2006-12-07 03:41 |
| 社区乞丐 Posts 90 Credits -49 | |
|
RE redtek :
My idea is to use the function of rundll32.exe to call functions to achieve the purpose in a single line. Because there is a function to replace the desktop background in user.dll, but there is no reaction when I call it in the command line with rundll32.exe. The key of my problem is not "changing the desktop background" but how to achieve it through rundll32.exe. Since rundll32.exe can call.dll functions, why can't batch processing use it for object-oriented programming like VB.VC? I have already implemented and used batch processing with the help of third-party plugins. The code for borrowing MS's "automatic wallpaper change" is as follows :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: COPY bgswitch.dll %WINDIR%\SYSTEM32\ COPY bgswitch.exe %WINDIR%\SYSTEM32\ REGSVR32 /S bgswitch.dll REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Directory" /t REG_SZ /d F:\Desktop Background\wallpaper /f REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Refresh Unit" /t REG_DWORD /d 0 /f REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Refresh Frequency" /t REG_DWORD /d 0 /f REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Random" /t REG_DWORD /d 0 /f REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Disabled" /t REG_DWORD /d 0 /f REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\BackgroundManager /v "Force Stretch" /t REG_DWORD /d 0 /f bgswitch ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Oh right, thank you for adding 5 points to my "TGHKSJ.CMD", heh heh :P [ Last edited by tghksj on 2006-12-6 at 02:54 PM ] |
|
| Floor4 lovehack2006 | Posted 2007-02-16 03:29 |
| 初级用户 Posts 64 Credits 135 | |
|
Good stuff...
|
|
| Floor5 anqing | Posted 2007-02-16 22:24 |
| 高级用户 Posts 413 Credits 859 | |
|
Bump, I also want to know the function of the API function
|
|
| Floor6 gne3 | Posted 2007-02-17 01:14 |
| 高级用户 Posts 252 Credits 526 | |
| Floor7 everest79 | Posted 2007-02-17 02:49 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
```
reg add "hkcu\control panel\desktop" /v TileWallpaper /d 0 /f reg add "hkcu\control panel\desktop" /v Wallpaper /d %wallpaper% /f reg add "hkcu\control panel\desktop" /v WallpaperStyle /d 2 /f RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters %wallpaper% is a BMP file with a full path ``` |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |