Programmatically change wallpaper in Windows 10?
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Risposte (1)
JohnGalt
il 15 Giu 2017
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 Commenti
Vedere anche
Categorie
Scopri di più su File Operations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!