When I execute netstat -a |find /C $portNumber
in command prompt I get the total number of lines where the given port number exists.
I want to get that same count in any variable so that I can check whether the port is already occupied or free in NSIS.
I am excuting the below command and I tried in many ways, but I'm not able to get the output of the ExecDos::exec in a variable or in the stack.
ExecDos::exec "netstat -a |find /C '$portNumber'| $output"