newbschoolin
New member
- Local time
- Yesterday, 22:28
- Joined
- Mar 1, 2012
- Messages
- 8
I have a form, it performs a lot of different functions. I have a button that opens a program, and at the end of the automation closes the program.
--To open the program--
Case "atlanta"
ChDir "C:\Program Files\Ericom Software\PowerTerm\"
Shell """C:\Program Files\Ericom Software\PowerTerm\ptw32.exe"" ATTLAB.PTS"
--To Close the program--
Shell "TaskKill /F /T -IM ptw32.exe"
--
The problem I am having is the close command is a pretty blunt CMD command and it kills any running instance of Powerterm(the program in question). I was wondering if anyone knows a way to isolate the instance that access opened and only close that process. I am familiar with /taskkill pid xxx but since the PID is never the same it does not seem like a viable option.
I am using a VERY blunt kill command to handle a somewhat delicate procedure. Like buttering a piece of bread with a long sword. Any advice would be appreciated.
--To open the program--
Case "atlanta"
ChDir "C:\Program Files\Ericom Software\PowerTerm\"
Shell """C:\Program Files\Ericom Software\PowerTerm\ptw32.exe"" ATTLAB.PTS"
--To Close the program--
Shell "TaskKill /F /T -IM ptw32.exe"
--
The problem I am having is the close command is a pretty blunt CMD command and it kills any running instance of Powerterm(the program in question). I was wondering if anyone knows a way to isolate the instance that access opened and only close that process. I am familiar with /taskkill pid xxx but since the PID is never the same it does not seem like a viable option.
I am using a VERY blunt kill command to handle a somewhat delicate procedure. Like buttering a piece of bread with a long sword. Any advice would be appreciated.