Netstat information via ColdFusion
I just found an old bit of ColdFusion code which ouputs Netstats results which I thought someone might find useful.
1 <!--
2 Name : netstat.cfm
3 Author : Andy Jarrett
4 Purpose : To display netstat information
5 -->
6
7 <cfset argsList = "a,b,e,n,o,p tcp,p udp,r,s,v"/>
8 <cfparam name="form.args" default="-1"/>
9
10 <cfoutput>
11 <form action="netstat.cfm" method="post">
12 <fieldset>
13 <legend>Netstat test</legend>
14 <div>
15 <label>Choose you argument</label>
16 <select name="args">
17 <cfloop list="#argsList#" index="i">
18 <option value="#i#">#i#</option>
19 </cfloop>
20 </select>
21 </div>
22 <input type="submit" name="sbt" value="Run"/>
23 </fieldset>
24 </form>
25
26 <cfif form.args NEQ -1>
27 <cftry>
28 <cfexecute name = "C:\windows\System32\netstat.exe"
29 arguments = "-#args#"
30 timeout = "3"
31 variable="netstat">
32 </cfexecute>
33 <xmp>#netstat#</xmp>
34 <cfcatch>
35 I don't know what you tried to do but it caused an error
36 <br/>
37 <strong>Problem:</strong> #cfcatch.message#
38 </cfcatch>
39 </cftry>
40 </cfif>
41 </cfoutput>
2 Name : netstat.cfm
3 Author : Andy Jarrett
4 Purpose : To display netstat information
5 -->
6
7 <cfset argsList = "a,b,e,n,o,p tcp,p udp,r,s,v"/>
8 <cfparam name="form.args" default="-1"/>
9
10 <cfoutput>
11 <form action="netstat.cfm" method="post">
12 <fieldset>
13 <legend>Netstat test</legend>
14 <div>
15 <label>Choose you argument</label>
16 <select name="args">
17 <cfloop list="#argsList#" index="i">
18 <option value="#i#">#i#</option>
19 </cfloop>
20 </select>
21 </div>
22 <input type="submit" name="sbt" value="Run"/>
23 </fieldset>
24 </form>
25
26 <cfif form.args NEQ -1>
27 <cftry>
28 <cfexecute name = "C:\windows\System32\netstat.exe"
29 arguments = "-#args#"
30 timeout = "3"
31 variable="netstat">
32 </cfexecute>
33 <xmp>#netstat#</xmp>
34 <cfcatch>
35 I don't know what you tried to do but it caused an error
36 <br/>
37 <strong>Problem:</strong> #cfcatch.message#
38 </cfcatch>
39 </cftry>
40 </cfif>
41 </cfoutput>
TweetBacks
There are no comments for this entry.
[Add Comment] [Subscribe to Comments]