Created
July 16, 2021 20:12
-
-
Save utilmind/ea93b036d0c3075756d539cba9159c67 to your computer and use it in GitHub Desktop.
set-background-color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: See also set-wallpaper.bat | |
@echo off | |
if [%1]==[] ( | |
echo USAGE: set-background-color.bat [6 hexadecimal digit color value] | |
echo EXAMPLE: "set-background-color.bat ffffff". This will set background color to white. | |
exit | |
) | |
echo Set solid background color to 0x%1 | |
:: Because the main color of our wallpaper is white. We need black color for the text on desktop icons... | |
powershell -command add-type -typedefinition """"using System;`n using System.Runtime.InteropServices;`n public class PInvoke { [DllImport(`"""user32.dll`""")] public static extern bool SetSysColors(int cElements, int[] lpaElements, int[] lpaRgbValues); }""""; [PInvoke]::SetSysColors(1, @(1), @(0x%1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment