accidental ampersand

lets say I am trying to type: batch1.btm & batch2.btm
but instead I accidentally type: batch1.btm &

My computer goes berserk. opening and closing windows like mad. I can't stop it.

1. Why is this happening?
2. what is the best way to halt?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,188
72
Albuquerque, NM
prospero.unm.edu
Code:
batch1.btm &
is just a synonym for
Code:
detach batch1.btm
DETACH should report the PID for the new process when it creates it; you can feed that PID to TASKEND to kill it.
 
May 20, 2008
10,498
77
Syracuse, NY, USA
lets say I am trying to type: batch1.btm & batch2.btm
but instead I accidentally type: batch1.btm &

My computer goes berserk. opening and closing windows like mad. I can't stop it.

1. Why is this happening?
2. what is the best way to halt?
I suspect the windows are those of transient instances of TCC, probably from pipes, or of instances of external programs. "TASKEND /F %_DETACHPID" (or do it manually from TaskMgr) should get rid of most or all of things.

But there's something I don't understand, namely piping in a detached instance. If I DETACH this BTM,
Code:
v:\> type abcd.btm
echo foo | grep foo
a console window for GREP.EXE opens and doesn't close. What's going on there?
 

rconn

Administrator
Staff member
May 14, 2008
11,894
133
But there's something I don't understand, namely piping in a detached instance. If I DETACH this BTM,
Code:
v:\> type abcd.btm
echo foo | grep foo
a console window for GREP.EXE opens and doesn't close. What's going on there?
GREP.EXE is an external app, and gets its own console window. There isn't any way to tell Windows that you want child pipe processes to be detached. (Nor can I imagine a situation where you would want to do this -- certainly nobody's brought it up in the last 15 years.)
 
May 20, 2008
10,498
77
Syracuse, NY, USA
GREP.EXE is an external app, and gets its own console window. There isn't any way to tell Windows that you want child pipe processes to be detached. (Nor can I imagine a situation where you would want to do this -- certainly nobody's brought it up in the last 15 years.)
The window doesn't surprise me. It's the fact that it doesn't close. Does the detached TCC produce standard output that should go to GREP?