Eddie Shipman
asked on
Setting Theme via shell script on Windows 10
I have a shell script that I've been using for Windows 7. It sets the theme for my system desktop. It no longer works now that I've moved to Windows 10.
With WScript.CreateObject("WScript.Shell")
WScript.echo "Open Theme dialog and select theme and then close"
.Run "rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:""%UserProfile%\AppData\Local\Microsoft\Windows\Themes\MyPersonal.theme"""
For i = 1 To 10
WScript.Sleep 5000
If .AppActivate("Personalization") Then
.Sendkeys "%FC"
.Sendkeys "{F4}"
Exit For
End If
Next
End With
I know I can open the Themes dialog using the run command andms-settings:themes
But how would I this as well as select the theme and close the dialog in a shell script on Windows 10?
This command works for me
"%UserProfile%\AppData\Local\Microsoft\Windows\Themes\MyPersonal.theme" & timeout /t 5 & taskkill /F /IM systemsettings.exe
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER