Andy Jarrett // Code. Develop. Create.

Netstat information via ColdFusion

I just found an old bit of ColdFusion code which ouputs Netstats results which I thought someone might find useful. <cfset argsList = "a,b,e,n,o,p tcp,p udp,r,s,v"/><cfparam name="form.args" default="-1"/><cfoutput>
Netstat test
<cfif form.args NEQ -1> <cftry> <cfexecute name = "C:\\windows\\System32\\netstat.exe" arguments = "-#args#" timeout = "3" variable="netstat"> </cfexecute> #netstat# <cfcatch> I don't know what you tried to do but it caused an error
Problem: #cfcatch.message# </cfcatch> </cftry> </cfif></cfoutput>

I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee. Your support keeps this site running and the coffee brewing! ☕️