I'm trying to write a batch file that does a few simple(?) things. My fundamental goal is to open a command window, perform a netstat command, then use PAUSE to wait for any key, then run the netstat command again in the same command window. Repeatedly, until I close the window.
When I just used Netstat, the command window self-terminated, so I found
cmd /k netstat would keep it open. But that doesn't help, because it only runs once.
So I tried a loop, and so far my syntax has been unsuccessful, I think because I need to use the cmd /k the first time, and a plain netstat command the second time... but I can't figure out how to get the batch file to insert additional netstat commands in the same command window.
but again, the subsequent netstat commands don't show when I hit a key and the command window is active.
Also, I'm not at that point yet, but I'm hoping this will remain linked to the command window; I will be bouncing to another program to perform activities, then will want to continually bounce back to the command window to check the IP address list.
the thing that has me stuck is pushing the second netstat to the command window; if I just use the cmd /k then it opens a new window each time, which isn't what I want- once that command window is open, how do I make that netstat 10 active?
cmd /k netstat
doesn't refresh the netstat every 10 seconds, it just does it once