In Windows, the batch processing of Port Link count statistics is semi-Original. It refers to a batch processing of windows directory and file count statistics from Baidu Library, it is currently used in online systems and called using vbs script files. The statistical function is normal. Www.2cto.com @ Echo off set/a = 0 netstat-an | find/I "port"> list file storage path for/f "delims =" % a in ('Type list file Storage path ') do set/a + = 1 @ Echo on echo "% date % time % ---- % a %" <nul> the Save path of the statistics file is briefly described here: set/a = 0 defines a variable and assigns a value to the variable here. If no value is assigned to the variable here, the problem of accumulating multiple times will occur in subsequent statistics; netstat-an | find/I "port" is used to find the corresponding port in the output information of the netstat command and redirect the information to a file, to facilitate the subsequent use of the "delims =" command is the command to set the windows cut string cutting point. For example, if a string is asadafag, use the post-word "delims = a" command. After the string is output, it becomes s d f g, just like-F in awk; for xx % a in ('xx ') do xx is the for loop in the batch processing; @ Echo off/on is the screen output that enables and disables echo, because the batch processing will directly output the value assignment result when assigning values to variables, therefore, you can disable screen output when assigning values, but you still need to enable it to save the results later.