Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Stopping netstat.exe after one display?

25 Mar 2015   #1
swiftie

Windows 7 Ultimate x64
 
 
Stopping netstat.exe after one display?

"netstat /?" says:

"interval Redisplays selected statistics, pausing interval seconds
between each display. Press CTRL+C to stop redisplaying
statistics. If omitted, netstat will print the current
configuration information once."

On my system, it keeps running displaying connections as they are established. What is that "If omitted" referring to?

Is there a way to get a snapshot without having to use Ctrl+C to quit netstat.exe?


My System SpecsSystem Spec
.
25 Mar 2015   #2
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

So by running netstat on its own, the command will display your current TCP/IP network connections and protocol statistics ONCE.

By running
Code:
netstat <SomePositiveNonzeroIntegerValueHere>
you are telling the netstat command to output your network connections and protocol statistics indefinitely. Once the command has finished displaying all statistics, it'll wait <SomePositiveNonzeroIntegerValueHere> seconds before repeating the netstat command again.

So running netstat 4 is kind of like running the batch script
Code:
@echo off
:top
netstat
timeout 4 >NUL
goto :top

Quote   Quote: Originally Posted by swiftie View Post
Is there a way to get a snapshot without having to use Ctrl+C to quit netstat.exe?
I'm not so sure what you mean by snapshot?
My System SpecsSystem Spec
25 Mar 2015   #3
swiftie

Windows 7 Ultimate x64
 
 

The bit that I'm struggling with is the "once". If I run "netstat -a -b" then I get a list of connections, but then netstat keeps running, adding new connections to the end of the list.

So, in order for netstat to terminate, I always have to Ctrl+C it.

It just seems a little odd, having to use Ctrl+C regardless of the parameters used. It's no big deal though, just a curiosity.
My System SpecsSystem Spec
.

25 Mar 2015   #4
Ztruker

Windows 10 Pro X64
 
 

Does the same for me on my Win 8 Pro X64 system and Win 7 Pro X64 system.
My System SpecsSystem Spec
26 Mar 2015   #5
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

I don't understand. I'm not sure what I'm supposed to be answering here.

Quote   Quote: Originally Posted by swiftie View Post
The bit that I'm struggling with is the "once". If I run "netstat -a -b" then I get a list of connections, but then netstat keeps running
...
So, in order for netstat to terminate, I always have to Ctrl+C it.
Are you saying that the output of the command netstat -a -b is infinity ongoing? It isn't. With a stopwatch in hand, for me, it takes just over 30 seconds at its quickest and 2 minutes at its longest for the command netstat -a -b to complete. Depending on how connection involved your machine is, the Net Status command can take a while to execute.


The title of this thread questions how one would go about halting the execution of a command after one cmd screen full of display. To answer that, you'd pipe to more.
E.g.
Code:
netstat | more
My System SpecsSystem Spec
26 Mar 2015   #6
Ztruker

Windows 10 Pro X64
 
 

Guess I didn't wait long enough. Took 39 seconds for me.
My System SpecsSystem Spec
Reply

 Stopping netstat.exe after one display?




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
What are all these connections in Netstat?
I typed in netstat and got all these connections, thing is though I don't know why all those ports are open, especially the 50,000 and up.
Network & Sharing
/cmd netstat gives me more than 40 ip addresses at once.. REALLy BAD?
so the 1st thing i noticed was when i right clicked the main tool bar and started the task manager i have a process named csrss.exe which i found out is a trojan... i ran avg and it got rid of two trojans but it still shows up on the processes.. i cant do anything to it either including go to the...
System Security
Netstat-B
I tried to use this but----no results I did the following; Hit start Entered cmd.exe Right click Administrator Enter code netstat-b
Performance & Maintenance
Netstat -b
Hi. I used the command netstat -b in the command prompt and I got a bunch of text that I don't know what it is. (I closed down all internet connections first, such as steam, web browser, etc.) Could you guys help me find out what these things are? Here's what it looks like: Prot. ...
Network & Sharing
netstat help!
Can someone please explain why when i do a netstat -a sometimes i get some hosts as ESTABLISHED on ports of which I have no idea what they are. Example: one was port 1866 using swrmi protocol. I read on the net that if there's anything showing up as established other that the programs that i...
Network & Sharing
netstat
Good evening you all, Can somebody explain to me why netstat -a gives the right output but netstat -b gives me a warning that i need administrators rights ..mine OS is Win7..is it a bug?.... Iam a Win7 tester
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 20:22.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App