Getting OS and Version Information from ColdFusion

As in many cases like this, dropping into Java helps us get the job done:

<cfset sys = createObject("java", "java.lang.System") />
<cfdump var="#sys.getProperties()#" />

So for example, if I need the version of the OS for a user string:

(Windows; U; Windows NT #x.getProperty("os.version")#; #x.getProperty("user.language")#-#x.getProperty("")#)

This outputs (Windows; U; Windows NT 6.1; en-IE) for me.

If you need to get ColdFusion details (such as version number) there is a handy struct in the SERVER scope:

<cfdump var="#SERVER.ColdFusion#" />
This entry was posted in regular and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s