WFS: get Windows running version

I used a function from that allows me to get the running Windows version to display the Trash icon for that version.

It was not updated for neither Windows 8/8.1 nor Windows 10.

It is a very complex function and I do not know how to do.

Tips ?

PS: the Trash icon is a sample, I forgot what other OS version specific image I change depending on the OS version.