Hi guys, yes another informational post i do hope this is useful to someone out there. So well i was just thinking and it popped into my mind to share these information with my readers. So below are a compilation of some command line tools which would be useful to troubleshoot a network for administrators, and also for
regular internet users connecting to web servers over a PPP(Point to Point Protocol(as in modem or router with internet access)) connection.Don't their uses will be included....Alright......
This commands are run in the command prompt application.....to open this just search the string command prompt in Windows or whichever OS it is you use, the commands are completely platform-independent...
Net.exe The
NET
command
is
the
primary
command-line
control
for
the
Windows
network
client. You
can
use
NET
to
perform
many
of
the
same
networking
functions
that
you
can
perform with
graphical
utilities,
such
as
Windows
Explorer
in
Windows
7
or
File
Explorer
in Windows
8.
Because
NET
is
a
command-line
utility,
you
can
include
the
commands
in
logon
scripts
and
batch
files.
For
example,
you
can
use
this
command
to
log
on
and
off
of the
network,
map
drive
letters
to
specific
network
shares,
start
and
stop
services,
and locate
shared
resources
on
the
network. To
use
the
program,
you
execute
the
file
from
the
command
line
with
a
subcommand, which
may
take
additional
parameters.
These
subcommands
and
their
functions
are
listed in
Table
26-1,
with
some
of
the
key
functions
being
examined
in
the
following
sections. The
subcommands
display
when
you
type
NET
in
the
Command
Prompt
dialog.
Windows
NET
Subcommands
NET
subcommands TCP/IP
Utilities Transmission
Control
Protocol/Internet
Protocol
(TCP/IP)
has
become
the
most commonly
used
protocol
suite
in
the
networking
industry,
and
many
network administration
and
troubleshooting
tasks
involve
working
with
various
elements
of
these protocols.
Because
virtually
every
computing
platform
supports
TCP/IP,
a
number
of
basic tools
have
been
ported
to
many
different
operating
systems,
some
of
which
have
also
been adapted
to
specific
needs.
The
following
sections
examine
some
of
these
tools
but
do
so more
from
the
perspective
of
their
basic
functionality
and
usefulness
to
the
network administrator
than
from
the
operational
elements
of
specific
implementations. Ping Ping
is
unquestionably
the
most
common
TCP/IP
diagnostic
tool
and
is
included
in virtually
every
implementation
of
the
TCP/IP
protocols.
In
most
cases,
Ping
is
a command-line
utility,
although
some
graphical
or
menu-driven
versions
are
available
that use
a
different
interface
to
perform
the
same
tasks.
The
basic
function
of
Ping
is
to
send
a message
to
another
TCP/IP
system
on
the
network
to
determine
whether
the
protocol
stack up
to
the
network
layer
is
functioning
properly.
Because
the
TCP/IP
protocols
function
in the
same
way
on
all
systems,
you
can
use
Ping
to
test
the
connection
between
any
two computers,
regardless
of
processor
platform
or
operating
system. Ping
works
by
transmitting
a
series
of
Echo
Request
messages
to
a
specific
IP
address using
the
Internet
Control
Message
Protocol
(ICMP).
When
the
computer
using
that
IP address
receives
the
messages,
it
generates
an
Echo
Reply
in
response
to
each
Echo Request
and
transmits
it
back
to
the
sender.
ICMP
is
a
TCP/IP
protocol
that
uses
several dozen
message
types
to
perform
various
diagnostic
and
error-reporting
functions.
ICMP messages
are
carried
directly
within
IP
datagrams.
No
transport
layer
protocol
is
involved, so
a
successful
Ping
test
indicates
that
the
protocol
stack
is
functioning
properly
from
the network
layer
down.
If
the
sending
system
receives
no
replies
to
its
Echo
Requests, something
is
wrong
with
either
the
sending
or
receiving
system
or
the
network
connection between
them. When
Ping
is
implemented
as
a
command-line
utility,
you
use
the
following
syntax
to perform
a
Ping
test: PING
destination where
the
destination
variable
is
replaced
by
the
name
or
address
of
another
system
on
the
network.
The
destination
system
can
be
identified
by
its
IP
address
or
by
a
name, assuming
that
an
appropriate
mechanism
is
in
place
for
resolving
the
name
into
an
IP address.
This
means
you
can
use
a
hostname
for
the
destination,
as
long
as
you
have
a DNS
server
or
HOSTS
file
to
resolve
the
name.
On
Windows
networks,
you
can
also
use NetBIOS
names,
along
with
any
of
the
standard
mechanisms
for
resolving
them,
such
as WINS
servers,
broadcast
transmissions,
or
an
LMHOSTS
file. The
screen
output
produced
by
a
ping
command
on
a
Windows
system
looks
like Figure
26-5.
Figure
26-5
Result
of
using
the
ping
command
in
a
Windows
7
system The
program
displays
a
result
line
for
each
of
the
four
Echo
Request
messages
it
sends by
default,
specifying
the
IP
address
of
the
recipient,
the
number
of
bytes
of
data transmitted
in
each
message,
the
amount
of
time
elapsed
between
the
transmission
of
the request
and
the
receipt
of
the
reply,
and
the
target
system’s
time
to
live
(TTL).
The
TTL
is the
number
of
routers
that
a
packet
can
pass
through
before
it
is
discarded. Ping
has
other
diagnostic
uses
apart
from
simply
determining
whether
a
system
is
up and
running.
If
you
can
successfully
ping
a
system
using
its
IP
address
but
pings
sent
to the
system’s
name
fail,
you
know
that
a
malfunction
is
occurring
in
the
name
resolution process.
When
you’re
trying
to
contact
an
Internet
site,
this
indicates
that
there
is
a problem
with
either
your
workstation’s
DNS
server
configuration
or
the
DNS
server
itself. If
you
can
ping
systems
on
the
local
network
successfully
but
not
systems
on
the
Internet, you
know
there
is
a
problem
with
either
your
workstation’s
Default
Gateway
setting
or
the connection
to
the
Internet.
NOTE
Sending
a
ping
command
to
a
system’s
loopback
address
(127.0.0.1) tests
the
operability
of
the
TCP/IP
protocol
stack,
but
it
is
not
an
adequate test
of
the
network
interface
because
traffic
sent
to
the
loopback
address travels
down
the
protocol
stack
only
as
far
as
the
network
transport
layer and
is
redirected
back
up
without
ever
leaving
the
computer
through
the network
interface.
In
most
Ping
implementations,
you
can
use
additional
command-line
parameters
to modify
the
size
and
number
of
the
Echo
Request
messages
transmitted
by
a
single
ping command,
as
well
as
other
operational
characteristics.
In
the
Windows
Ping.exe
program, for
example,
the
parameters
are
as
follows: ping
[-t]
[-a]
[-n
count]
[-l
size]
[-f]
[-i
TTL]
[-v
TOS]
[-r
count]
[-s count]
[[-j
host-list]
|
[-k
host-list]]
[-w
timeout]
destination •
-t
Pings
the
specified
destination
until
stopped
by
the
user
(with
CTRL-C) •
-a
Resolves
destination
IP
addresses
to
hostnames •
-n
count
Specifies
the
number
of
Echo
Requests
to
send •
-l
size
Specifies
the
size
of
the
Echo
Request
messages
to
send •
-f
Sets
the
IP
Don’t
Fragment
flag
in
each
Echo
Request
packet •
-i
TTL
Specifies
the
IP
TTL
value
for
the
Echo
Request
packets •
-v
TOS
Specifies
the
IP
Type
of
Service
(TOS)
value
for
the
Echo
Request packets •
-r
count
Records
the
IP
addresses
of
the
routers
for
the
specified
number of
hops •
-s
count
Records
the
time
stamp
from
the
routers
for
the
specified
number of
hops •
-j
host-list
Specifies
a
partial
list
of
routers
that
the
packets
should
use •
-k
host-list
Specifies
a
complete
list
of
routers
that
the
packets
should
use •
-w
timeout
Specifies
the
time
(in
milliseconds)
that
the
system
should
wait for
each
reply There
are
many
different
applications
for
these
parameters
that
can
help
you
manage your
network
and
troubleshoot
problems.
For
example,
by
creating
larger-than-normal Echo
Requests
and
sending
large
numbers
of
them
(or
sending
them
continuously),
you can
simulate
user
traffic
on
your
network
to
test
its
ability
to
stand
up
under
heavy
use. You
can
also
compare
the
performance
of
various
routes
through
your
network
(or
through the
Internet)
by
specifying
the
IP
addresses
of
the
routers
that
the
Echo
Request
packets must
use
to
reach
their
destinations.
The
-j
parameter
provides
loose
source
routing,
in which
the
packets
must
use
the
routers
whose
IP
addresses
you
specify
but
can
use
other routers
also.
The
-k
parameter
provides
strict
source
routing,
in
which
you
must
specify the
address
of
every
router
that
packets
will
use
to
reach
their
destination. Pathping Combining
the
features
of
both
Tracert
and
Ping,
Pathping,
designed
for
networks
with more
than
one
router
between
hosts,
sends
a
series
of
packets
to
each
router
along
the route
to
the
host.
Any
packet
loss
at
any
link
along
the
route
is
pinpointed
by
Pathping. Traceroute
or
Tracert Traceroute
is
another
utility
that
is
usually
implemented
as
a
command-line
program
and
included
in
most
TCP/IP
protocol
stacks,
although
it
sometimes
goes
by
a
different
name. On
Mac,
Linux,
or
Unix
systems,
the
command
is
called
traceroute,
but
Windows implements
the
same
functions
in
a
program
called
Tracert.exe.
The
function
of
this
tool
is to
display
the
route
that
IP
packets
are
taking
to
reach
a
particular
destination
system. Each
of
the
entries
in
a
trace
represents
a
router
that
processed
the
packets
generated by
the
Traceroute
program
on
the
way
to
their
destination.
In
each
entry
there
are
three numerical
figures
that
specify
the
round-trip
time
to
that
router,
in
milliseconds,
followed by
the
DNS
name
and
IP
address
of
the
router.
In
a
trace
to
an
overseas
destination,
the round-trip
times
are
relatively
high
and
can
provide
you
with
information
about
the backbone
networks
your
ISP
uses
and
the
geographical
path
that
your
traffic
takes.
For example,
when
you
run
a
trace
to
a
destination
system
on
another
continent,
you
can sometimes
tell
when
the
path
crosses
an
ocean
by
a
sudden
increase
in
the
round-trip times.
On
a
private
network,
you
can
use
Traceroute
to
determine
the
path
through
your routers
that
local
traffic
typically
takes,
enabling
you
to
get
an
idea
of
how
traffic
is distributed
around
your
network. Most
Traceroute
implementations
work
by
transmitting
the
same
type
of
ICMP
Echo Request
messages
used
by
Ping,
while
others
use
UDP
packets
by
default.
The
only difference
in
the
messages
themselves
is
that
the
Traceroute
program
modifies
the
TTL field
for
each
sequence
of
three
packets.
The
TTL
field
is
a
protective
mechanism
that prevents
IP
packets
from
circulating
endlessly
around
a
network.
Each
router
that processes
a
packet
decrements
the
TTL
value
by
one.
If
the
TTL
value
of
a
packet
reaches zero,
the
router
discards
it
and
returns
an
ICMP
Time
to
Live
Exceeded
in
Transit
error message
to
the
system
that
originally
transmitted
it. In
the
first
Traceroute
sequence,
the
packets
have
a
TTL
value
of
1,
so
that
the
first router
receiving
the
packets
discards
them
and
returns
error
messages
back
to
the
source. By
calculating
the
interval
between
a
message’s
transmission
and
the
arrival
of
the associated
error,
Traceroute
generates
the
round-trip
time
and
then
uses
the
source
IP address
in
the
error
message
to
identify
the
router.
In
the
second
sequence
of
messages,
the TTL
value
is
2,
so
the
packets
reach
the
second
router
in
their
journey
before
being discarded.
The
third
sequence
of
packets
has
a
TTL
value
of
3,
and
so
on,
until
the messages
reach
the
destination
system. It
is
important
to
understand
that
although
Traceroute
can
be
a
useful
tool,
a
certain amount
of
imprecision
is
inherent
in
the
information
it
provides.
Just
because
a
packet transmitted
right
now
takes
a
certain
path
to
a
destination
does
not
mean
that
a
packet transmitted
a
minute
from
now
to
that
same
destination
will
take
that
same
path.
Networks (and
especially
those
on
the
Internet)
are
mutable,
and
routers
are
designed
to
compensate automatically
for
the
changes
that
occur.
The
route
taken
by
Traceroute
packets
to
their destination
can
change,
even
in
the
midst
of
a
trace,
so
it
is
entirely
possible
for
the sequence
of
routers
displayed
by
the
program
to
be
a
composite
of
two
or
more
different paths
to
the
destination
because
of
changes
that
occurred
in
midstream.
On
a
private network,
this
is
less
likely
to
be
the
case,
but
it
is
still
possible. Route The
routing
table
is
a
vital
part
of
the
networking
stack
on
any
TCP/IP
system,
even
those
that
do
not
function
as
routers.
The
system
uses
the
routing
table
to
determine
where
it should
transmit
each
packet.
The
Route.exe
program
in
Windows
and
the
route
command included
with
most
other
versions
enable
you
to
view
the
routing
table
and
add
or
delete entries
to
it.
The
syntax
for
the
Windows
Route.exe
program
is
as
follows: ROUTE
[-f]
[-p]
[command
[destination]
[MASK
netmask]
[gateway]
[METRIC metric]
[IF
interface]] The
command
variable
takes
one
of
the
following
four
values: •
PRINT
Displays
the
contents
of
the
routing
table •
ADD
Creates
a
new
entry
in
the
routing
table •
DELETE
Deletes
an
entry
from
the
routing
table •
CHANGE
Modifies
the
parameters
of
a
routing
table
entry The
other
parameters
used
on
the
Route.exe
command
line
are
as
follows: •
–f
Deletes
all
of
the
entries
from
the
routing
table •
–p
Creates
a
permanent
entry
in
the
routing
table
(called
a
persistent
route) when
used
with
the
ADD
command •
destination
Specifies
the
network
or
host
address
of
the
routing
table
entry being
added,
deleted,
or
changed •
MASK
netmask
Specifies
the
subnet
mask
associated
with
the
address specified
by
the
destination
variable •
gateway
Specifies
the
address
of
the
router
used
to
access
the
host
or network
address
specified
by
the
destination
variable •
METRIC
metric
Indicates
the
relative
efficiency
of
the
routing
table
entry •
IF
interface
Specifies
the
address
of
the
network
interface
adapter
used
to reach
the
router
specified
by
the
gateway
variable Netstat Netstat
is
a
command-line
utility
that
displays
network
traffic
statistics
for
the
various TCP/IP
protocols
and,
depending
on
the
platform,
may
display
other
information
as
well. Nearly
all
operating
systems
support
Netstat.
The
command-line
parameters
for
Netstat can
vary
in
different
implementations,
but
one
of
the
most
basic
ones
is
the
-s
parameter, which
displays
the
statistics
for
each
of
the
major
TCP/IP
protocols,
as
shown
in
Figure 26-6.
Figure
26-6
Netstat
creates
a
display
of
IP
statistics. Apart
from
the
total
number
of
packets
transmitted
and
received
by
each
protocol, Netstat
provides
valuable
information
about
error
conditions
and
other
processes
that
can help
you
troubleshoot
network
communication
problems
at
various
layers
of
the
OSI model.
The
Windows
version
of
Netstat
also
can
display
Ethernet
statistics
(using
the
-e parameter),
which
can
help
to
isolate
network
hardware
problems. When
executed
with
the
-a
parameter,
Netstat
displays
information
about
the
TCP
connections
currently
active
on
the
computer
and
the
UDP
services
that
are
listening
for input.
The
State
column
indicates
whether
a
connection
is
currently
established
or
a program
is
listening
on
a
particular
port
for
messages
from
other
computers,
waiting
to establish
a
new
connection. Nslookup Nslookup
is
a
utility
that
enables
you
to
send
queries
directly
to
a
particular
DNS
server
in order
to
resolve
names
into
IP
addresses
or
request
other
information.
Unlike
other
name resolution
methods,
such
as
using
Ping,
Nslookup
lets
you
specify
which
server
you
want to
receive
your
commands
so
that
you
can
determine
whether
a
DNS
server
is
functioning properly
and
whether
it
is
supplying
the
correct
information.
Originally
designed
for
Unix systems,
an
Nslookup
program
is
available
on
Mac,
Linux,
and
Windows
systems. Nslookup
can
run
in
either
interactive
or
noninteractive
mode.
To
transmit
a
single
query, you
can
use
noninteractive
mode,
using
the
following
syntax
from
the
command
prompt: Nslookup
hostname
nameserver Replace
the
hostname
variable
with
the
DNS
name
or
IP
address
that
you
want
to resolve,
and
replace
the
nameserver
variable
with
the
name
or
address
of
the
DNS
server that
you
want
to
receive
the
query.
If
you
omit
the
nameserver
value,
the
program
uses
the system’s
default
DNS
server. To
run
Nslookup
in
interactive
mode,
you
execute
the
program
from
the
command prompt
with
no
parameters
(to
use
the
default
DNS
server)
or
with
a
hyphen
in
place
of the
hostname
variable,
followed
by
the
DNS
server
name,
as
follows: Nslookup
–
nameserver The
program
produces
a
prompt
in
the
form
of
an
angle
bracket
(>),
at
which
you
can type
the
names
or
addresses
you
want
to
resolve,
as
well
as
a
large
number
of
commands that
alter
the
parameters
that
Nslookup
uses
to
query
the
name
server.
You
can
display
the list
of
commands
by
typing
help
at
the
prompt.
To
exit
the
program,
press
CTRL-C. Ipconfig The
Ipconfig
program
is
a
simple
utility
for
displaying
a
system’s
TCP/IP
configuration parameters.
This
is
particularly
useful
when
you
are
using
Dynamic
Host
Configuration Protocol
(DHCP)
servers
to
automatically
configure
TCP/IP
clients
on
your
network because
there
is
no
other
simple
way
for
users
to
see
what
settings
have
been
assigned
to their
workstations.
Nearly
all
systems
include
the
ipconfig
command
(derived
from interface
configuration).
This here is a quick summary to spare you guys all the details.
1. NET
2. IPCONFIG
3. NETSTAT
4. ROUTE
5. PING
6. TRACERT
7. PATHPING.
So instead of having to read all of the above, just type one of these commands in the app's window together with a "/" and "?". example ; PING /? or this PING -?, it would pop up all of the usages of that command.
SECOND SECTION
So like always source code guys......this one is used too create a directory in java programming
import java.util.Formatter;
public class CreateDirectory {
public static void main(String args[]){
try{
Formatter dir = new Formatter("C:\\test\\input-file.txt");
dir.format("%s %s %s","1 ","John ","Smith \r\n");
dir.format("%s %s %s","2 ","Pablo ","Escober");
dir.close();
}
catch(Exception e){System.out.println("error");}
}
}
short and easy just include this in whichever way it would be useful to your program....
SECTION 3
This one is kind of special, source code for a simple and basic log in system in java but also a little stylish...
and also this one is written in eclipse so the code are i suppose more legible and understandable..
as for the image file you simply would have to create a small icon that represents a mouse listener point for
closing the application or you might as well ignore that part...
package AppPackage;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
public class CustomLogin extends JFrame {
private JTextField password;
private JTextField name;
private JRadioButton clear;
int xMouse, yMouse, x, y;
int width = Toolkit.getDefaultToolkit().getScreenSize().width;
int height = Toolkit.getDefaultToolkit().getScreenSize().height;
String UserName = "David";
String Password = "9000";
private JLabel display;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
CustomLogin frame = new CustomLogin();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public CustomLogin() {
getContentPane().addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
xMouse = e.getX();
yMouse = e.getY();
}
});
getContentPane().addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
x = e.getXOnScreen();
y = e.getYOnScreen();
setLocation(x - xMouse, y - yMouse);
}
});
setLocation(width / 2 - 193, height / 2 - 125);
// setLocationRelativeTo(null);
setUndecorated(true);
setType(Type.UTILITY);
getContentPane().setFont(new Font("Kristen ITC", Font.PLAIN, 16));
setTitle("LOGIN");
getContentPane().setBackground(new Color(152, 251, 152));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(386, 250);
getContentPane().setLayout(null);
password = new JTextField();
password.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 14));
password.setBounds(10, 121, 281, 42);
getContentPane().add(password);
password.setColumns(10);
name = new JTextField();
name.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 14));
name.setBounds(10, 39, 281, 45);
getContentPane().add(name);
name.setColumns(10);
JButton btnNewButton = new JButton("Login");
btnNewButton.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 11));
btnNewButton.setForeground(new Color(0, 0, 128));
btnNewButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0){
if (name.getText().equals(UserName)
&& password.getText().equals(Password)){
display.setForeground(Color.BLACK);
display.setText("Successful Login");
} else {
display.setForeground(Color.RED);
display.setText("Wrong Login Details");
}
}
});
btnNewButton.setBorder(UIManager.getBorder("ToolTip.border"));
btnNewButton.setBounds(20, 174, 89, 23);
getContentPane().add(btnNewButton);
display = new JLabel("");
display.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
xMouse = e.getX();
yMouse = e.getY();
}
});
display.setBounds(30, 212, 159, 27);
getContentPane().add(display);
JLabel lblNewLabel_1 = new JLabel("NAME");
lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_1
.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 11));
lblNewLabel_1.setBounds(297, 49, 63, 26);
getContentPane().add(lblNewLabel_1);
JLabel lblNewLabel_2 = new JLabel("PASSWORD");
lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_2
.setFont(new Font("Kravitz Extra Thermal", Font.PLAIN, 11));
lblNewLabel_2.setBounds(301, 128, 69, 29);
getContentPane().add(lblNewLabel_2);
JLabel lblNewLabel_3 = new JLabel("");
lblNewLabel_3.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent arg0) {
System.exit(0);
}
});
lblNewLabel_3.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_3.setIcon(new ImageIcon("C:\\Users\\DAVID\\Pictures\\cdr designs\\icons\\Tiny_button.png"));
lblNewLabel_3.setBounds(345, 11, 31, 27);
getContentPane().add(lblNewLabel_3);
clear = new JRadioButton("clear");
clear.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
if(clear.isSelected()) {
name.setText(null);
password.setText(null);
display.setText(null);
clear.setSelected(false);
}
}
});
clear.setOpaque(false);
clear.setBounds(293, 171, 74, 29);
getContentPane().add(clear);
}
}