Programmatically change wallpaper in Windows 10?
조회 수: 9 (최근 30일)
이전 댓글 표시
답변 (1개)
JohnGalt
2017년 6월 15일
this can be done with a '.cmd' file... which can be executed from the matlab command window using 'system()' ... this starts by copying the wallpaper using 'copy "new_Wallpaper.jpg" "C:\Wallpaper.jpg"' - this is a snippet of code I found online and I can't seem to find the original to give it proper credit... anyway:
@ECHO OFF
:: Paste the wallpaper, desired, due to its extension (type bmp or jpg), for an own folder within it. Do not modify the name of the desired file
copy "new_Wallpaper.jpg" "C:\Wallpaper.jpg"
:: Add the required values ​​to the registry, if these people are using a System Wallpaper. If they have always modified their wallpapers, the following lines are not necessary. "They have no habit of hurting themselves, constantly"
REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "C:\Wallpaper.jpg"
:: Modify the following line in the last number to 0 if you want to center the bitmap on the desktop. Change the last number in the following line to 2 if you wish to extend the bitmap vertically and horizontally to fit on your desktop.
REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 0
:: Change to 0 (zero), the last number not to "pave" the image, set it to A (1) will be tiled.
REG ADD "HKCU\Control Panel\Desktop" /V TileWallpaper /T REG_SZ /F /D 0
:: The following lines energize desktop
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
::The following line locks (locks) the workstation (server).
::%SystemRoot%\System32\RUNDLL32.EXE user32.dll, LockWorkStation
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!