I’ve been trying to set my wallpaper in Windows 10 by doing the following in a command prompt window:
reg add "HKEY_CURRENT_USERControl PanelDesktop" /v Wallpaper /t REG_SZ /d wallpaper_directory /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
This works once, but then if I try to change the wallpaper soon after it, it does not work.
Am I doing something wrong or how do I fix this?
Mofi
44.8k16 gold badges77 silver badges137 bronze badges
asked Oct 27, 2017 at 23:11
Logan DavenportLogan Davenport
1711 gold badge2 silver badges6 bronze badges
1
It is very simple go to C:UsersyournameAppDataRoamingMicrosoftWindowsThemes here you find one image with name TranscodedWallpaper. Rename your image to TranscodedWallpaper and replace in this location(don’t keep extension). Do same thing inside cachedFile folder also.
After exicute RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True then your wallpaped got change
answered Jun 18, 2019 at 6:30
Apparently, «RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters» (with or without «1, True» or «2, True») leads to inconsistent results (at least on my PC). I found the following PowerShell script, that always works on my PC: https://c-nergy.be/blog/?p=15291, option 2:
#-------------------------------------------------------------------#
# ScriptName : SetWall.ps1 #
# Description : Force a Desktop wallpaper Refresh #
# Credits : Unknown (if you know original creator, let us know) #
# #
# Date : 01 July 2020 #
#-------------------------------------------------------------------#
#Modify Path to the picture accordingly to reflect your infrastructure
$imgPath="\Domain.labnetlogonWallpaper.png"
$code = @'
using System.Runtime.InteropServices;
namespace Win32{
public class Wallpaper{
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ;
public static void SetWallpaper(string thePath){
SystemParametersInfo(20,0,thePath,3);
}
}
}
'@
add-type $code
#Apply the Change on the system
[Win32.Wallpaper]::SetWallpaper($imgPath)
answered Apr 18, 2021 at 10:17
0
I’ve been trying to set my wallpaper in Windows 10 by doing the following in a command prompt window:
reg add "HKEY_CURRENT_USERControl PanelDesktop" /v Wallpaper /t REG_SZ /d wallpaper_directory /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
This works once, but then if I try to change the wallpaper soon after it, it does not work.
Am I doing something wrong or how do I fix this?
Mofi
44.8k16 gold badges77 silver badges137 bronze badges
asked Oct 27, 2017 at 23:11
Logan DavenportLogan Davenport
1711 gold badge2 silver badges6 bronze badges
1
It is very simple go to C:UsersyournameAppDataRoamingMicrosoftWindowsThemes here you find one image with name TranscodedWallpaper. Rename your image to TranscodedWallpaper and replace in this location(don’t keep extension). Do same thing inside cachedFile folder also.
After exicute RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True then your wallpaped got change
answered Jun 18, 2019 at 6:30
Apparently, «RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters» (with or without «1, True» or «2, True») leads to inconsistent results (at least on my PC). I found the following PowerShell script, that always works on my PC: https://c-nergy.be/blog/?p=15291, option 2:
#-------------------------------------------------------------------#
# ScriptName : SetWall.ps1 #
# Description : Force a Desktop wallpaper Refresh #
# Credits : Unknown (if you know original creator, let us know) #
# #
# Date : 01 July 2020 #
#-------------------------------------------------------------------#
#Modify Path to the picture accordingly to reflect your infrastructure
$imgPath="\Domain.labnetlogonWallpaper.png"
$code = @'
using System.Runtime.InteropServices;
namespace Win32{
public class Wallpaper{
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ;
public static void SetWallpaper(string thePath){
SystemParametersInfo(20,0,thePath,3);
}
}
}
'@
add-type $code
#Apply the Change on the system
[Win32.Wallpaper]::SetWallpaper($imgPath)
answered Apr 18, 2021 at 10:17
0
- Remove From My Forums
-
Question
-
Hi people,
did someone know how change the wallpaper with a command line ?
thx a lot
Answers
-
Hi,
I think this can be done with PowerShell. We could create a function to set wallpaper:
Function Set-WallPaper($Value)
{
Set-ItemProperty -path ‘HKCU:Control PanelDesktop’ -name wallpaper -value $value
rundll32.exe user32.dll, UpdatePerUserSystemParameters
}
Open PowerShell; paste the function above in it to make this function work.
Now, if you want to change some wallpaper, you could type the following text:
Set-WallPaper -value «the path of you wallpaper«
If you are interested, I would like to share the following article with you for your reference:
Hey, Scripting Guy! How Can I Hide
My Desktop Wallpaper?If you need some help on writing this script, you can also post your question to The Official Scripting Guys Forum:
The
Official Scripting Guys ForumHope this helps. Thanks.
Alex Zhao
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
-
Marked as answer by
Friday, November 19, 2010 6:02 AM
-
Marked as answer by
-
Hi Alex, i found 2 other solution.
the first one is to change the theme. like that (line command)
rundll32.exe %SystemRoot%system32shell32.dll,Control_RunDLL %SystemRoot%system32desk.cpl desk,@Themes /Action:OpenTheme /file:""YOUPATH to the .theme"""
the second one use a thirdparty freeware how work with command line to just change one wallpaper
http://www.optimumx.com/downloads.html#SetWallpaper (it it work under Win.7)
Thank for your Powersheel Solution (damn i need to learn Powershell
)
-
Marked as answer by
Leon Liu — MS
Friday, November 19, 2010 6:02 AM
-
Marked as answer by
-
These answers are right, but didn’t work too smoothly for me on a 2008 R2 server.
If you just want to change a single image rather that updating the registry, then for a 2008 R2 box you need to replace this file:
c:users<UserName>AppDataRoamingMicrosoftWindowsThemesTrancodedWallpaper.jpg
and then for some reason I needed to run this command twice:
rundll32.exe
user32.dll, UpdatePerUserSystemParametersI was doing this with Powershell to automate a testbox setup after a CloneReplication job. What to check for though is the users «Themes» folder listed above encase it is named differently or you are using BMP files. if you are using PowerShell
then you can find out the path and file name with:Get-ItemProperty -path ‘HKCU:Control PanelDesktop’ | Select -Property WallPaper
Of course Cloud_TS has shown a good PowerShell Function to set that to whatever you want, which could be reshaped to centralise the WallPaper across multiple users or groups of users.
I was looking for a simple swap and refresh and it was knowing the location and that I needed to run the
rundll32.exe twice that was really slowing me down.Regards,
Grae Hunter
-
Marked as answer by
James_Patageul
Sunday, August 27, 2017 1:38 PM
-
Marked as answer by
- Remove From My Forums
-
Question
-
Hi people,
did someone know how change the wallpaper with a command line ?
thx a lot
Answers
-
Hi,
I think this can be done with PowerShell. We could create a function to set wallpaper:
Function Set-WallPaper($Value)
{
Set-ItemProperty -path ‘HKCU:Control PanelDesktop’ -name wallpaper -value $value
rundll32.exe user32.dll, UpdatePerUserSystemParameters
}
Open PowerShell; paste the function above in it to make this function work.
Now, if you want to change some wallpaper, you could type the following text:
Set-WallPaper -value «the path of you wallpaper«
If you are interested, I would like to share the following article with you for your reference:
Hey, Scripting Guy! How Can I Hide
My Desktop Wallpaper?If you need some help on writing this script, you can also post your question to The Official Scripting Guys Forum:
The
Official Scripting Guys ForumHope this helps. Thanks.
Alex Zhao
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
-
Marked as answer by
Friday, November 19, 2010 6:02 AM
-
Marked as answer by
-
Hi Alex, i found 2 other solution.
the first one is to change the theme. like that (line command)
rundll32.exe %SystemRoot%system32shell32.dll,Control_RunDLL %SystemRoot%system32desk.cpl desk,@Themes /Action:OpenTheme /file:""YOUPATH to the .theme"""
the second one use a thirdparty freeware how work with command line to just change one wallpaper
http://www.optimumx.com/downloads.html#SetWallpaper (it it work under Win.7)
Thank for your Powersheel Solution (damn i need to learn Powershell
)
-
Marked as answer by
Leon Liu — MS
Friday, November 19, 2010 6:02 AM
-
Marked as answer by
-
These answers are right, but didn’t work too smoothly for me on a 2008 R2 server.
If you just want to change a single image rather that updating the registry, then for a 2008 R2 box you need to replace this file:
c:users<UserName>AppDataRoamingMicrosoftWindowsThemesTrancodedWallpaper.jpg
and then for some reason I needed to run this command twice:
rundll32.exe
user32.dll, UpdatePerUserSystemParametersI was doing this with Powershell to automate a testbox setup after a CloneReplication job. What to check for though is the users «Themes» folder listed above encase it is named differently or you are using BMP files. if you are using PowerShell
then you can find out the path and file name with:Get-ItemProperty -path ‘HKCU:Control PanelDesktop’ | Select -Property WallPaper
Of course Cloud_TS has shown a good PowerShell Function to set that to whatever you want, which could be reshaped to centralise the WallPaper across multiple users or groups of users.
I was looking for a simple swap and refresh and it was knowing the location and that I needed to run the
rundll32.exe twice that was really slowing me down.Regards,
Grae Hunter
-
Marked as answer by
James_Patageul
Sunday, August 27, 2017 1:38 PM
-
Marked as answer by
есть ли возможность командной строки, чтобы изменить цвет фона рабочего стола Windows?
Я хочу установить фон рабочего стола для использования сплошных цветов (синий — rgb: 57, 109, 166) без фонового изображения. Единственное чтение, которое я нахожу, о том, как изменить обои для рабочего стола.
источник
фон хранится в реестре. Есть несколько различных способов установить его. Но есть несколько способов установить значение реестра через командную строку.
чтобы установить фон на определенный цвет, вам нужно снять любые обои и установить цвет.
HKEY_CURRENT_USERControl PanelColorsBackground = 'r g b'
HKEY_CURRENT_USERControl PanelDesktopWallpaper = ''
отвечен Zoredache 2014-12-10 22:13:51
источник
Я не думаю, что это вариант, но вы можете легко изменить цвет фона, щелкнув правой кнопкой мыши на рабочем столе, выбрав «Персонализация», выбрав «фон рабочего стола» и выбрав «сплошные цвета». Кроме того, вы можете сделать 1 пиксель х 1 пиксель изображения цвета вы хотите, и установить в качестве фона изображения.
источник
Если вы хотите сделать это автоматически, например, с помощью сценария входа или пакетного файла, вы можете использовать следующее:
ECHO Clearing Background ...
reg add "HKEY_CURRENT_USERControl PanelDesktop" /v WallPaper /t REG_SZ /d " " /f
reg add "HKEY_CURRENT_USERControl PanelColors" /v Background /t REG_SZ /d "0 0 0" /f
отвечен Klondicke 2018-03-16 20:44:50
источник

)