Get the logged on user - code which works!

Some VBscript code which ACTUALLY works. I don’t understand some sites which share code. You go looking for VBscript code on the net to do something, and invariably IT DOES NOT WORK.

For one of two reasons:

it’s a code snippet, and you need to write code around it to get it to work [...]