Jump to content

[req]Change theme not working


Recommended Posts

What I am doing on Windows Server 2012 R2 is creating my custom theme from inside an installed OS. I open up Personalize, change my desktop background, sounds, screensaver, etc, right click on the unsaved theme, and save the file on my desktop as a .themepack.

Then from my first logon script, I run this command under each user account and it applies the theme, which I kept in the same folder with my setupcomplete.cmd for simplicity.

Partial contents of my 'FirstLogon.ps1' script.


Not sure what OS we are talking about, but it should work on 8.1 the same way.

Haven't tracked down the way to alter the default theme OEM style yet, but it's probably plausible depending on the source of the default theme (if registry based, yes easy, if DLL hardcoded in a signed block, maybe harder)

Edited by MrJinje
Link to comment
Share on other sites

themepack works on 8.1 as MrJinje said

but I call an autoit in Firstlogoncommands that installs and then closes Personalization

CMD /C start /wait %systemdrive%\Install\maxXPsoft_AU3.exe

WinWaitNotActive ("Personalization")Run(@ComSpec & " /c " &@ScriptDir&"\maxXPsoft.themepack", "", @SW_HIDE)WinWaitActive ("Personalization")Sleep (5000)send ("!{F4}")Exit
Edited by maxXPsoft
Link to comment
Share on other sites

Good trick Max, I can't beat auto-it (because of the way Control Panel hwnd's are handled) but here is the powershell alternative. The caveat being it cannot activate the personalization window.

C:\Windows\Setup\Scripts\BLACK_SILENCE_NO_SCREENSAVER_2012_R2.deskthemepackStart-Sleep 5[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');[Microsoft.VisualBasic.Interaction]::AppActivate("Personalization")[void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[System.Windows.Forms.SendKeys]::SendWait("%{F4}")

Updated snippet with VBS style AppActivate method.



Edited by MrJinje
Link to comment
Share on other sites

This works if set via the group policy (or likely via group policy in the $OEM$ folders trick). Create the setting in gpedit.msc, then copy your "C:\Windows\System32\GroupPolicy" folder into your $OEM$ folders @ ($OEM$\$$\System32 folder)

gpedit.msc > User Config > Admin Templates > Control Panel  > Personalization > Load a specific theme

When I did it via gpedit.msc, it created 2 files registry.pol and comment.cmtx, and we probably don't need the comment file.

FYI, the setting only works prior to first logon, so it won't seem to work if you already logged with an account as it will not change anything, you'll have to delete that user profile and logon again, which will cause windows to go through the 'setting up your profile' magics on first logon.

Doing so edits this setting. But you cannot use the .reg HKCU to push the setting because it only occurs during first logon, hence timing paradox. Maybe we could try editing the default user profile @ HKU\.DEFAULT - Or could try it from HKLM and see if it will push across the machine via undocumented setting.

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Personalization]"ThemeFile"="C:\\Windows\\Setup\\Scripts\\SOLID_BLACK_SOUNDS_DISABLED_2012_R2.deskthemepack"


Edited by MrJinje
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...