It is currently December 11th, 2018, 2:31 pm

netstat

General topics related to Rainmeter.
Peter1107
Posts: 3
Joined: April 20th, 2012, 7:12 am

netstat

Peter1107 » June 12th, 2012, 11:20 pm

a sample code for netstat, I want to create a skin that will show me the occupied ports. is rainmeter supports netstat?
User avatar
jsmorley
Developer
Posts: 18451
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: netstat

jsmorley » June 12th, 2012, 11:36 pm

Peter1107 wrote:a sample code for netstat, I want to create a skin that will show me the occupied ports. is rainmeter supports netstat?
No, not really. You could execute a vbs script or something that executes "netstat >SomeFile.txt" in DOS and then use Lua to open, read and parse the text file and pass values back to Rainmeter in a variety of ways. However, netstat is VERY slow to run while it is enumerating your connections, and can easily take 10-30 seconds just to create the text file. It will be very difficult to use that in any reliable and efficient way in Rainmeter, as you are as often as not going to be reading the file while it is being created and have problems.

There may be some way to cobble together something that makes it more reliable, but it's never going to be very "real time" due to how slow netstat is in executing.
Ivan Lopes
Posts: 1
Joined: October 6th, 2018, 10:18 pm

Re: netstat

Ivan Lopes » October 6th, 2018, 10:20 pm

Existe alguma opção diferente para resolver essa questão?

Is there a different option to solve this question?