The CMD crisis

I really like being familiar with command line tools, however, in reality I often find myself searching on line for some command I know I used before but just can't seem to remember. In a past life (read "job") I was able to turn around and ask a fellow lead dev who seemed to have The Hitchhiker's Guide to the Galaxy and Window's command line syntax burned into his psyche in no particular order of precedence. We called him "Inspector Gadget" because, when you were looking for the odd utility, tool or command, he was your man. Alas, today I had to resort to Google (MS employees here read "Live Search") Here are a few reminders I needed today and some new stuff I learned. Hopefully I'll remember to look here next time.

Ping - Pretty basic stuff

What I did learn, though, is that you can alter the timeout wait period using the -w [milliseconds to wait] flag.

So, if you think that a longer timeout may help diagnose a slow connection you can stretch the wait to 10 seconds like so:
Ping 1.1.1.1 -w 10000

Tracert - up just a notch from ping

I am not a network guy by any means, but if I see slow times between two servers I want to see what lies between.

You can set the same -w flag on tracert that you can on ping and lengthen the timeout if you think that may alter your results

You can also limit the number of hops with the -h flag. With a lengthened timeout, say 10 seconds, and the default 30 hops, you won't be going anywhere for a while if the trace is timing out. So to lengthen the timeout but limit the hops to 10:

tracert 1.1.1.1 -w 10000 -h 10

Printing out the results

I remembered the ">" flag to direct output to a text file like so:

Ping >mylog.txt 1.1.1.1

What I learned that was new (to me) was that I could also append to an existing file with the ">>" flag to build up a running diagnostics log as I went. So to add a tracert to the ping results I could execute this command.

tracert >>mylog.txt 1.1.1.1

Some good command line syntax references

http://commandwindows.com/command1.htm

http://www.ss64.com/nt/

 

© Copyright 2009 - Andreas Zenker

2 Comments

Comments have been disabled for this content.