I am trying to write a batch script that errors if port 1099 is already in use.
Unfortunately, I have to write it to a DOS script package (I cannot install anything).
I know that I can manually print the PID of the hogging port of process 1099:
netstat -aon | findstr ":1099"
But I want to be able to run this command in a batch script and exit the script with an error message if this command has any output.
I assume that when I clicked, I could redirect the output to a temporary file and check its size, but this seems really hacked ...
windows dos port batch-file
matt burns
source share