Hello and welcome to Command Line
Basics. In this video, we're going
to go over Windows System commands
to I'm Christopher Haler and this
begin.
The learning objectives for this
video is that we are going to
understand the task of this command,
understand the task, kill command,
and then learn about the S.
C command.
Precisely.
The command can be used to start
and stop services.
Is this true or false?
The answer is true, the C command
stands for service control,
and he's very, very useful to be
able to start and stop services
from the command line.
We can also query specific
information about a service and see
if it's running, see if it's going
to start automatically when the
computer reboots.
A whole lot of other very useful
information.
So the C command is something that
you should be very aware of and
should be very comfortable using.
All right, so the task, this
command, what this does on a Windows
machine is a display all of
the running processes on the
machine.
We'll show you the PID, the process
idea for a process,
how much memory the process is using
and the name of the current process
as well, also known as the image
name. So this can be used to
troubleshoot a specific process
if you're having trouble with
something being stuck
or if you have a process that you
know should not be running, we can
run the task list, see if it is
running or not, and then we can use
that information with the task.
And then when I'd like to keep in
mind, two is the task list.
Command can be useful in trying to
identify malware that may be present
on a machine if you see
evil that is running
in your task list.
That's a pretty good indication that
that task should be running.
And if we're using the nets that
come in to try and identify
different processes that are talking
out to the Internet, then we can
also use the task list command to
help verify the information and
we can compare the pin and see how
it is working.
All right. So let me pull up my
command prompt.
I'm going to type in task list,
and I have a whole bunch of tasks
running right now so I
can see all of this different
information running.
It'll show the this is the PID
right here and
shows also how much memory each
of these are using.
So very useful information.
Now, let's say I'm going to run the
notepad from the command
prompt.
It's going to type in no pen and
enter brings up this empty notepad
window.
Now, if I run a task list again,
we do. We have notepad down here
and it is PID 40,
80.
So let's go on to task kill,
this is used to end a writing
process so we could use
either the pig or the image name
of the process, and it is usually
used in the step process
or something that's hanging or it's
not responding properly.
So this is very useful to be able
to end that process.
So either we can start it again or
focus on doing a different
task.
So if I go back to the command
problem, we can see I have the
notepad running.
So first of all, it's to task
kill question
questionmark because we want to make
sure that we are doing
what we should be doing.
So it looks like we
are going to do Task Hill Forward
Slash PID and then the pit number.
And it's important to read through
the documentation, especially for
these types of commands,
where we're going to end the
process, that we don't do
anything that we aren't intending
to.
So let's say notepad
is 40, 80,
so let's do task to
fit four zero
eight zero.
As we can see, we got the notepad
open right here.
Let's run it.
But let me make sure I spell that
properly.
I'm missing another L
and look that our notepad is going.
And if we do a task list again,
we'll see. No pad is no longer
in his list.
So it's very useful to be able to
end a process that we don't want
running.
And then we have to commend the
service control command.
This interacts directly with the
service control manager for a
Windows system, and we can either
query, start, pause or stop
services.
And the query, it will give you
information about the service if
it's running at that time, if it
will start automatically
or delayed start and
a lot more information about the
service itself, we'd start
postop.
Those are pretty self-explanatory.
We can also create a failure action
as well for a specific service
so we can say, hey, the service
ends unexpectedly.
I want you to run this specific
command.
And that could be a command to
either alert administrators or to
boot up a second executable.
So it would be very useful to be
comfortable with that.
So let's say I want to take a look
at the Adobe Armed Service.
So I'm going to run NSC query
Adobe Armed Service.
So
and I did spell it correctly so
we can see that it is running
right now.
It is a stoppable.
It's not possible and it doesn't
ignore shut down.
So let's say we want to stop
this.
So I'm going to push up, OK,
delete the query and type
in stop.
And now we could see to stop pending
because it comes immediately back
and it says, hey, I submitted your
command. It's pending a stop right
now.
So let's go up and look at queries
and we can see that this service is
stopped right now.
Now, same deal.
If we want to start the series,
you can just go to start.
And same exact thing is stopping
it's going to send it off and say,
hey, we have to start spending for
this process right here
and now, if we do a query again,
we can see it's running.
So this is very useful to be able to
troubleshoot, start, stop or change
different information about a
service at the Windows command line.
All right. So post assessment, what
does the task kill command need
to end a process?
Is it a rapid B
system info?
C, service failure action
or D? The process must be paused
A, the PID.
This is the process ID that
the task command uses
in order to end the process.
And I highly recommend using the PID
instead of the image
name of the process because it's
usually very common to have more
than one of the same process running
under the same name.
So in order to in the specific
process that you want to end,
use the PID because the pit is
always different for each process,
even if they have the same name.
So system info does not work
of a serious failure.
Action is for a
service, not for a process,
and the process does not need to be
paused.
You can edit whether it's stuck
running over anything
that's really going on.
In this video. We understood the
task list came in, we understood
the task kill command and we
learned the SC Service Control
Command. And I hope to see you in
the next video.