Is there a stop command?

  • Thread starter J. P. Gilliver (John)
  • Start date
J

J. P. Gilliver (John)

Is there a command that can be used, say in a batch file, that stops a
running command (or command tree)?

I mean, if I see in Task Manager that xyz.exe and abc.exe are running,
is there something that I could use, such as

stop abc.exe
stop xyz.exe

that would do the same - if run in a batch file - as stopping them using
Task Manager's facilities would?

[I tried "stop", and it doesn't exist (-:]

If there is, would it need to know their full path?

(And yes, I know killing processes is often not advisable.)
 
J

J. P. Gilliver (John)

David H. said:
From: "J. P. Gilliver (John) said:
Is there a command that can be used, say in a batch file, that stops a
running command (or command tree)? []
(And yes, I know killing processes is often not advisable.)


Microsoft (R) Windows NT (TM) Version 3.5 KILL
Copyright (C) 1994-1998 Microsoft Corp. All rights reserved

usage: KILL [options] <<pid> | <pattern>>*

[options]:
-f Force process kill

What does the -f option do - or rather, what does omitting it do? (I'm
guessing that without it it's like using an application's close button
if it's got one, but with -f it's more like killing it from Task
Manager, i. e. more likely to close at the cost of more likely data loss
- is that right?)
<pid>
This is the process id for the task
to be killed. Use TLIST to get a
valid pid

Which I probably wouldn't know if I was writing a batch file, unless the
same process always gets the same PID.
<pattern>
The pattern can be a complete task
name or a regular expression pattern
to use as a match. Kill matches the
supplied pattern against the task names
and the window titles.
So "kill xyz.exe" would probably kill process xyz.exe? (Would it need
the ".exe"?)
[]
(Rest - including TASKKILL - kept for reference; thanks. Mostly way over
my head!)
 
P

Paul

J. P. Gilliver (John) said:
So "kill xyz.exe" would probably kill process xyz.exe? (Would it need
the ".exe"?)
[]
(Rest - including TASKKILL - kept for reference; thanks. Mostly way over
my head!)

I like this one. I think that kills
*all* the notepads. Use a PID (process ID
number) instead, if you want a "precision" kill.

TASKKILL /IM notepad.exe

Open a Command Prompt window and test it out.
Start a couple of Notepads, and verify it
got both of them.

*******

What a command like Taskkill cannot stop
effectively, is a fork bomb. I've never
tested fork bombs on Windows, and only had
to stop a couple on Unix (no, not my own).

On Linux/Unix, they have kill() and killpg(),
and killpg is the one I look to, to stop a
fork bomb. They have the notion of process groups
and process group IDs (PGID). If you can find
the parent of the thing that has gone nuts,
killing it with killpg() kills all the
forked children as well. I don't know if
Windows has any program that implements the
same idea or not, as I don't think Windows
has process groups.

http://en.wikipedia.org/wiki/Fork_bomb

http://linux.die.net/man/2/killpg

It's great fun trying to stop runaway computers.

The last one that got the best of me, was
Windows 8, when the Task Manager stopped
responding, and I couldn't do anything other
than hit the power button. By comparison,
Task Manager on WinXP is pretty damn good
(it works when you need it the most). Not
so on Windows 8.

Paul
 
J

J. P. Gilliver (John)

In message <[email protected]>, Paul <[email protected]>
writes:
[]
I like this one. I think that kills
*all* the notepads. Use a PID (process ID
number) instead, if you want a "precision" kill.

TASKKILL /IM notepad.exe

Open a Command Prompt window and test it out.
Start a couple of Notepads, and verify it
got both of them.

Sounds just what I need! I tried what you suggested.

Unfortunately - both from the "Run" box and a cmd window - "Windows
cannot find 'TASKKILL'". (Wording slightly different from the cmd window
but same meaning.) Is this because I have XP Home?
*******

What a command like Taskkill cannot stop
effectively, is a fork bomb. I've never
tested fork bombs on Windows, and only had
to stop a couple on Unix (no, not my own).

I wonder if that's similar to the choice in Task Manager of Kill Process
versus Kill Process Tree. (Or similar wording.)
[]
It's great fun trying to stop runaway computers.

(-: I don't _think_ I've had one - not for many years anyway; I do
remember certain _websites_ used to pop up windows faster than I could
close them, but browsers have probably improved sufficiently that such
is no longer a problem.
The last one that got the best of me, was
Windows 8, when the Task Manager stopped
responding, and I couldn't do anything other
than hit the power button. By comparison,
Task Manager on WinXP is pretty damn good
(it works when you need it the most). Not

Ah, XP now has the same position in our hearts '9x did: we know its
wrinkles, and it "feels" more controllable.
so on Windows 8.

I think 7 is less responsive in that respect too. Certainly the "going
pale" is something I never saw on XP, though that could just be a
different (and arguably slightly more visible) way of _showing_
something is unresponsive.
 
P

Paul

J. P. Gilliver (John) said:
Sounds just what I need! I tried what you suggested.

Unfortunately - both from the "Run" box and a cmd window - "Windows
cannot find 'TASKKILL'". (Wording slightly different from the cmd window
but same meaning.) Is this because I have XP Home?

Not a surprise really. If they won't give Home users
a "tasklist /svc", why would they give them a "taskkill" ?
The mind boggles.

Taskkill shows as a separate .exe on my machine, so
maybe you can test a "copy" of taskkill.exe from a
WinXP Pro machine.

C:\WINDOWS\system32\taskkill.exe

*******

If I look in "WindowsXP-KB936929-SP3-x86-ENU.exe" SP3
redistributable using 7-ZIP, I see "taskkill.ex_".

You can click that one and select "open inside", and the
name then changes to taskkill.exe 76,288 bytes. Maybe
that one can be coaxed to work for you. My guess is,
if you look at the Version info, it'll be 5.1.2600.5512.
It's never been patched on my machine, since the SP3 timeframe.

Paul
 
J

J. P. Gilliver (John)

Sounds just what I need! I tried what you suggested.
Unfortunately - both from the "Run" box and a cmd window - "Windows
cannot find 'TASKKILL'". (Wording slightly different from the cmd
window but same meaning.) Is this because I have XP Home?

Not a surprise really. If they won't give Home users
a "tasklist /svc", why would they give them a "taskkill" ?
The mind boggles.

Taskkill shows as a separate .exe on my machine, so
maybe you can test a "copy" of taskkill.exe from a
WinXP Pro machine.

C:\WINDOWS\system32\taskkill.exe

*******

If I look in "WindowsXP-KB936929-SP3-x86-ENU.exe" SP3
redistributable using 7-ZIP, I see "taskkill.ex_".

You can click that one and select "open inside", and the
name then changes to taskkill.exe 76,288 bytes. Maybe
that one can be coaxed to work for you. My guess is,
if you look at the Version info, it'll be 5.1.2600.5512.
It's never been patched on my machine, since the SP3 timeframe.

Paul[/QUOTE]

Unfortunately, I have no file whose name contains 936929 under Windows
either.
 
P

Paul

J. P. Gilliver (John) said:
Unfortunately, I have no file whose name contains 936929 under Windows
either.

Unfortunately, I'm referring to the SP3 redistributable download :)

If you buy a WinXP Gold CD, from eons ago, there are updates
like SP1, SP1a, SP2, SP3. These are available as .exe files,
suited for possession by an IT person. You install the Service
Packs, to bring the system up to date. There are various rules
as to whether the updates are installed sequentially or the update
is cumulative. The design is "mostly cumulative", with some exceptions.
Perhaps you can go from SP1a patch level to SP3,
using WindowsXP-KB936929-SP3-x86-ENU.exe .

Even though I'm not an IT guy, I keep a set of these files.
It allows me to access files for reference purposes, and using
7-ZIP, that's what I'm doing in this case. If I need a file,
and I don't trust "Joes download site" to give me a copy,
I instead extract it from the .exe I've got.

*******

"WindowsXP-KB936929-SP3-x86-ENU.exe"

http://www.microsoft.com/en-us/download/details.aspx?id=24

For reference, SP2

http://www.microsoft.com/en-us/download/details.aspx?id=28

For reference, SP1a (broken download, size info only)
xpsp1a_en_x86.exe 125.1 MB 2/3/2003

http://web.archive.org/web/20070415...79-FA3A-48BF-ADE5-023443E29D78&displaylang=en

SP1a is SP1 with Java removed (to settle Java court case).

*******

So you can get SP3 and SP2, if you need access to the odd
file. Not everything will be in there, and those are not
"OS installers". They're for patching an install, with
any files that have changed. Those can also save you a
tiny amount of Windows Update time, if doing a re-installation,
in that using your SP1 installer CD, followed by installing
the SP3 .exe, should reduce the remaining Windows Updates
to only a hundred plus or so. I have no idea how many it
would be if you just let it go ahead on its own. You'd think
the logic would be smart enough to install SP3 first, if it
was needed.

Another way to patch up a system, would be with Wsusoffline,
and I have that on a USB stick. I think I've tested that
once, and nothing seemed to immediately break. So if you've
already loaded all the Microsoft files on a USB stick, that
would save download time on a reinstallation. Wsusoffline
would have a copy of SP3 316.6MB in it as well. Wsusoffline
uses the Microsoft download manifest, and the downloads
come from Microsoft itself. This is only practical, if you
see yourself repairing a lot of PCs (in a shop). I have mine
prepared for a special situation - family member on dialup,
not a chance in hell of ever doing enough Windows Update
to get patched up to date. So the USB key will be part
of my "Care Package" :)

Paul
 
J

J. P. Gilliver (John)

J. P. Gilliver (John) said:
If I look in "WindowsXP-KB936929-SP3-x86-ENU.exe" SP3
redistributable using 7-ZIP, I see "taskkill.ex_".
[]
Unfortunately, I have no file whose name contains 936929 under
Windows either.

Unfortunately, I'm referring to the SP3 redistributable download :)

Ah, sorry - I didn't realise it was the whole of SP3, since it had a KB
number!
If you buy a WinXP Gold CD, from eons ago, there are updates
like SP1, SP1a, SP2, SP3. These are available as .exe files,
suited for possession by an IT person. You install the Service
Packs, to bring the system up to date. There are various rules
as to whether the updates are installed sequentially or the update
is cumulative. The design is "mostly cumulative", with some exceptions.

Page http://www.microsoft.com/en-us/download/details.aspx?id=24 says
"Windows XP Service Pack 3 (SP3) includes all previously released
updates for the operating system. This update also includes a small
number of new functionalities, which do not significantly change
customers’ experience with the operating system.", so it looks as if
that one _is_ cumulative.
Perhaps you can go from SP1a patch level to SP3,
using WindowsXP-KB936929-SP3-x86-ENU.exe .

Well, the above suggests I could even go from SP0? (Not that I need to;
this machine came with SP3. Home, unfortunately.)
Even though I'm not an IT guy, I keep a set of these files.

Sorry, you can't deny it - you _are_! And I think most of the readers of
this newsgroup will back me up on that. What you do for a _living_ is
another matter ... (-:
It allows me to access files for reference purposes, and using
7-ZIP, that's what I'm doing in this case. If I need a file,
and I don't trust "Joes download site" to give me a copy,
I instead extract it from the .exe I've got. []
http://www.microsoft.com/en-us/download/details.aspx?id=24

Thanks for that. Now got it!
For reference, SP2

http://www.microsoft.com/en-us/download/details.aspx?id=28

For reference, SP1a (broken download, size info only)
xpsp1a_en_x86.exe 125.1 MB 2/3/2003

http://web.archive.org/web/20070415203712/http://www.microsoft.com/downl
oads/details.aspx?familyid=83E4E879-FA3A-48BF-ADE5-023443E29D78&displayl
ang=en

SP1a is SP1 with Java removed (to settle Java court case).
_Are_ those needed in view of what the above says about SP3 being
cumulative?
[]
Another way to patch up a system, would be with Wsusoffline,
and I have that on a USB stick. I think I've tested that
once, and nothing seemed to immediately break. So if you've
already loaded all the Microsoft files on a USB stick, that
would save download time on a reinstallation. Wsusoffline
would have a copy of SP3 316.6MB in it as well. Wsusoffline
uses the Microsoft download manifest, and the downloads
come from Microsoft itself. This is only practical, if you
see yourself repairing a lot of PCs (in a shop). I have mine

Hmm. I _do_ have wsus, though I don't seem to have run it since
2014-9-29. I don't really expect to use it - I'm now using Macrium for
backup - but I like to _think_ I could rebuild a(n XP) PC from scratch
if I _had_ to.
prepared for a special situation - family member on dialup,
not a chance in hell of ever doing enough Windows Update
to get patched up to date. So the USB key will be part
of my "Care Package" :)

Paul

Similar, I guess! (Not so much dialup, but limited time I could stay
with some of my supportees.)
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf

Hadrian's Wall has never been a border between Scotland and England. It lies
entirely within England but, when it was built in AD 122 by the Romans as a
defence against the raiding Picts, the future English were still in Germany
and the Scottish were still in Ireland.
- Michael Cullen, Skye, in RT 2014/12/6-12
 
P

Paul

J. P. Gilliver (John) said:
J. P. Gilliver (John) said:
In message <[email protected]>, Paul <[email protected]>
writes: []
If I look in "WindowsXP-KB936929-SP3-x86-ENU.exe" SP3
redistributable using 7-ZIP, I see "taskkill.ex_". []
Unfortunately, I have no file whose name contains 936929 under
Windows either.

Unfortunately, I'm referring to the SP3 redistributable download :)

Ah, sorry - I didn't realise it was the whole of SP3, since it had a KB
number!
If you buy a WinXP Gold CD, from eons ago, there are updates
like SP1, SP1a, SP2, SP3. These are available as .exe files,
suited for possession by an IT person. You install the Service
Packs, to bring the system up to date. There are various rules
as to whether the updates are installed sequentially or the update
is cumulative. The design is "mostly cumulative", with some exceptions.

Page http://www.microsoft.com/en-us/download/details.aspx?id=24 says
"Windows XP Service Pack 3 (SP3) includes all previously released
updates for the operating system. This update also includes a small
number of new functionalities, which do not significantly change
customers’ experience with the operating system.", so it looks as if
that one _is_ cumulative.
Perhaps you can go from SP1a patch level to SP3,
using WindowsXP-KB936929-SP3-x86-ENU.exe .

Well, the above suggests I could even go from SP0? (Not that I need to;
this machine came with SP3. Home, unfortunately.)
Even though I'm not an IT guy, I keep a set of these files.

Sorry, you can't deny it - you _are_! And I think most of the readers of
this newsgroup will back me up on that. What you do for a _living_ is
another matter ... (-:
It allows me to access files for reference purposes, and using
7-ZIP, that's what I'm doing in this case. If I need a file,
and I don't trust "Joes download site" to give me a copy,
I instead extract it from the .exe I've got. []
http://www.microsoft.com/en-us/download/details.aspx?id=24

Thanks for that. Now got it!
For reference, SP2

http://www.microsoft.com/en-us/download/details.aspx?id=28

For reference, SP1a (broken download, size info only)
xpsp1a_en_x86.exe 125.1 MB 2/3/2003

http://web.archive.org/web/20070415203712/http://www.microsoft.com/downl
oads/details.aspx?familyid=83E4E879-FA3A-48BF-ADE5-023443E29D78&displayl
ang=en

SP1a is SP1 with Java removed (to settle Java court case).
_Are_ those needed in view of what the above says about SP3 being
cumulative?
[]
Another way to patch up a system, would be with Wsusoffline,
and I have that on a USB stick. I think I've tested that
once, and nothing seemed to immediately break. So if you've
already loaded all the Microsoft files on a USB stick, that
would save download time on a reinstallation. Wsusoffline
would have a copy of SP3 316.6MB in it as well. Wsusoffline
uses the Microsoft download manifest, and the downloads
come from Microsoft itself. This is only practical, if you
see yourself repairing a lot of PCs (in a shop). I have mine

Hmm. I _do_ have wsus, though I don't seem to have run it since
2014-9-29. I don't really expect to use it - I'm now using Macrium for
backup - but I like to _think_ I could rebuild a(n XP) PC from scratch
if I _had_ to.
prepared for a special situation - family member on dialup,
not a chance in hell of ever doing enough Windows Update
to get patched up to date. So the USB key will be part
of my "Care Package" :)

Paul

Similar, I guess! (Not so much dialup, but limited time I could stay
with some of my supportees.)

I'm not 100% positive about the "from-to" table
on Service Packs.

There was some rumblings, that SP0 to SP3 wouldn't
work, or something goes missing. So I'd have to
couch my advice, with perhaps a stop at SP1a, then
on to SP3. I don't know if a web search has the
necessary info on this or not. If you're running
SP1 or SP2, as far as I know, installing SP3 should
be enough.

I generally don't take chances, and just archive anything
that has the potential to be of use later. This means on
some OS updates, I keep both 32 bit and 64 bit files.
For example, I keep incremental files to bring Win8
mostly up to date, for both 32 bit and 64 bit. Currently
my two Win8 paid installs are 64 bit, but that doesn't
prevent me from archiving the 32 bit ones. Now, if
there was a WSUSoffline for Windows 8, I'd likely end
up downloading those files all over again.

Paul
 
H

Hot-Text

J. P. Gilliver (John) said:
Is there a command that can be used, say in a batch file, that stops a
running command (or command tree)?

I mean, if I see in Task Manager that xyz.exe and abc.exe are running,
is there something that I could use, such as

stop abc.exe
stop xyz.exe

Running Program processes

C:\My Program\abc.exe exist
or
C:\Windows\xyz.exe quit

that would do the same - if run in a batch file - as stopping them using
Task Manager's facilities would?

[I tried "stop", and it doesn't exist (-:]

If there is, would it need to know their full path?

Yes the processes full path
(And yes, I know killing processes is often not advisable.)

processes Name

Run
Start

exist
quit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top