I have spent the last two days fighting the Internet.
For a week a small percentage of high uptime web-sites have been missing and not responding to pings.
Two days ago the Internet disintegrated, and had difficulty logging in to Gmail, and when I was in and clicked on Calendar that was down.
70% of all sites were down 70% of the time.
There were no 404 error messages - the DNS just failed to resolve names into IP addresses.
I vaguely remembered forthcoming DNS doom, and eventually found
"DNSSEC unlikely to break Internet on May 5" - an article on
http://blogs.techrepublic.com.com/itdojo/?p=1713Utter desperation after all else failed,
I abandoned my Router's default of using DNS servers chosen by my ISP,
and tried my son's preference -
immediately every-one was on-line again. ! ! !
Hence my unavoidable delay in getting back.
Thanks, but I had no success.
But you gave me an idea after struggling.
This one line does the job
Code: Select all
start "USE Ctrl'C to terminate NETSTAT Logging and close this Window" cmd /c netstat -b 5 ^>activity.txt
This script simply launches a new CHILD instance of CMD.EXE to support NetStat, and terminates.
I avoid the /min option, so the CHILD has focus and is able to receive the Ctrl'C from the keyboard and immediately and cleanly close down
I do not know of a way to put a "USE Ctrl'C to terminate ..." message WITHIN the CMD Window,
but consider the Title bar to be almost as good a place to put it.
The following is my summary of failure and what went wrong should any-one be interested.
It was only as I previewed and went to SUBMIT that I realised Ctrl'C might get into netstat if it was not minimized - then single line success.
Regards and Thanks
Alan
test/debug script NETSTOP.BAT
Code: Select all
@echo off
ECHO XLOWTEST IS RUNNING
start "NetstatLog" cmd /c netstat -b 5 ^>activity.txt
pause>nul|set /p "=Press any key to quit netstat logging ... "
echo %TIME%
goto :EOF
pause
echo %TIME%
ECHO now wait until a list of tsks is presented
tasklist
echo %TIME%
echo o.k. to proceed and see if "tskill netstat.*" will work
pause
echo %TIME%
tskill netstat.*
echo %TIME%
ECHO XLOWTEST IS ENDING
PAUSE
When I double click this Windows launches a "MOTHER" instance of CMD.EXE to run it,
and the script then starts "CHILD" instance of CMD.EXE to execute netstat.
MOTHER then issues time stamps and requests "wait until a list of tasks is presented",
then it lists the task that are running.
After another time stamp and continue it follows with
17:42:47.50
and then it FAILS to kill netstat.* with the error message
"Could not find process: netstat.*"
17:42:48.64
It took 1.14 seconds trying, and failing to kill the process.
FACT 1
MOTHER never lost focus, i.e. CHILD and grandchild netstat.exe never saw any Ctrl'C that could have stopped the logging of activity by netstat.exe
FACT 2
MOTHER can use Tasklist and see her CHILD cmd.exe, and also see the grandchild netstat.exe,
but MOTHER is unable to kill her grandchild whilst it is still logging -
good granny - but why pretend it could not find it when it has already listed it ! !
It looked as if netstat.exe logging at 5 second intervals caused a sort of "file in use" objection by Windows to the killing of that task, until
FACT 3
UNCLE CMD.EXE, separately launched, and no "family blood ties" to netstat, has no problem killing netstat.exe whilst it is still logging.
If I remove the option "/min" the the CHILD would gain focus, and Ctrl'C would stop the logging
Below is what appeared on the NETSTOP.BAT window up to the final PAUSE and shutdow,
but with 2 dozen tasks omitted for the sake of brevity - something I am not noted for ! !
XLOWTEST IS RUNNING
Press any key to quit netstat logging ... 17:42:19.57
Press any key to continue . . .
17:42:35.88
now wait until a list of tasks is presented
Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
System Idle Process 0 Console 0 16 K
cmd.exe 3076 Console 0 1,124 K
svchost.exe 3220 Console 0 4,816 K
taskmgr.exe 2664 Console 0 2,160 K
wmiprvse.exe 2976 Console 0 6,488 K
cmd.exe 732 Console 0 2,520 K
cmd.exe 2072 Console 0 3,428 K
netstat.exe 1840 Console 0 4,204 K
tasklist.exe 3276 Console 0 4,988 K
17:42:38.24
o.k. to proceed and see if "tskill netstat.*" will work
Press any key to continue . . .
17:42:47.50
Could not find process: netstat.*
17:42:48.64
XLOWTEST IS ENDING
Press any key to continue . . .