Hi
I'm trying to change the Windows theme based on the PC name of the machine. I think most things work however, I can't seem to get it to change. Although I can double click the .theme file in Explorer and it changes in my C# code it returns.
System.ComponentModel.Win32Exception: 'The specified executable is not a valid application for this OS platform.'
Thanks in advance for any suggestions.
I'm trying to change the Windows theme based on the PC name of the machine. I think most things work however, I can't seem to get it to change. Although I can double click the .theme file in Explorer and it changes in my C# code it returns.
System.ComponentModel.Win32Exception: 'The specified executable is not a valid application for this OS platform.'
Thanks in advance for any suggestions.
C#:
string CurrentTheme = (string)Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\", "CurrentTheme", null);
string myLastSubString = CurrentTheme.Split('\\').Last();
txtCurrentTheme.Text = myLastSubString;
txtPCName.Text = Environment.MachineName;
if (txtCurrentTheme.Text != txtPCName.Text + ".theme")
{
var filename = "C:\\Themes\\STS_Theme-" + txtPCName.Text + ".theme";
System.Diagnostics.Process.Start(filename);
}