After shell, how to close xcopy instance?

  • Thread starter Thread starter sandal
  • Start date Start date
S

sandal

If I run xcopy via shell, with the hidden option, I can't find a way to
close the instance of xcopy. Typical efforts like
http://www.mvps.org/access/api/api0025.htm don't work, because the class
name is not visible. I have a task id from shell, but I'm not sure how
to close an application using the task id.
 
Hi Roger

That is interesting but not sure it'd help. That code detects when a
process ends; I want to end a process. xcopy.exe just hangs around after
it's processed the command I sent it. I am able to 'know' when xcopy is
done, via testing for the expected result, but am not sure how to bump
off the still running copy of xcopy.exe.
 
Can you put the call to xcopy in a batch file?
I'm asking xopy to move a set of widely dispersed files around; ie
they're not all in a single dir. I could write out the command to a bat
file and execute that. Are you thinking that a bat file via shell would
'go away' after execution completed? Makes sense.

What's odd is that I've found that sometimes xcopy executed via shell
does clear out by itself. I can't see anything that makes a difference,
other than the file copied. I've seen xcopy instances left running, or
none, in sequential tests.

I think there must be a way to use the task id returned by shell to
close the executed application. I'm going to experiment with the code at
the link below, which may be suitable.

http://www.freevbcode.com/ShowCode.Asp?ID=670
 
Back
Top