It would only work if the person allowed execution of the code. With security high these days, probably wouldn't work. You can tell their browser and ISP. But to have the client execute code in such a way is a huge vulnerability.
http://www.belarc.com
That site lets you download an application, which does what you're asking. It even gives you the CD key's that some of your applications are using in case you forgot them.