When I try to compile a C# file with an icon it works up to a size of 256x256 pixels but when I try it on another computer with Windows XP it throws an error and only works with a size up to 128x128 pixels.
My way to solve it was to try 256 first and if it throws an error try 128:
SET CompilerPath=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\csc.exe
CALL %CompilerPath% -win32icon:Icon256.ico Code.cs && (
  ECHO Successfully compiled with icon 256.
) || (
  CALL %CompilerPath% -win32icon:Icon128.ico Code.cs && (
    ECHO Successfully compiled with icon 128.
  ) || (
    ECHO Failed to compile.
  )
)
My question is if there is an actual way to check which size the computer/OS supports.
