|
|
|||||||
Hi Everyone I need to write a little script that will check if the application is alreasy running, if not then run it. Well seems really easy, but when running the application it opens up a process name called "ntvdm.exe", and then 4 child PIDs under the parent PID. Then when I clode down the application 3 of the child PIDs clode down but it leaves 1 child PID called WOWEXEC.EXE. So what I am really asking is that I cannot use EnumProcess, to check for the PID number as it looks at the parent pid and not a child pid. So do you think there is another other way. Thanks |
||||||||
|
|
|||||||
borrowing from wintaskspro library: Quote: now I must ask, why you need to get rid of this? it's not that huge so it can be left running just fine. not sure do all of the 16-bit instances share the same process or do they start their own, but... this is part of the OS, so I think it's perfectly fine to leave it there. |
||||||||
|
|
|||||||
Hi Everyone Thanks for replying, I don;t really care about wowexec.exe but another Child PID called ASCShell.exe, but when using UDF EnumProcess, it only shows Parent objects. This is because it uses WMI (Select * from Win32_Process). Any other ideas. Thanks |
||||||||
|
|
|||||||
Does that make sence ?? |
||||||||
|
|
|||||||
What about - PsInfo PsKill Kent |
||||||||
|
|
|||||||
Nope PSKill shows only parent pids, and psinfo does not show info regarding processes. Rich |
||||||||
|
|
|||||||
so, this is not working: shell "kill -f ASCShell.exe" I know it works for kix (without logging me off ) |
||||||||
|
|
|||||||
Thanks, but I am not trying to kill the process, just check that it is there. AscShell.exe is a child process of NTDVM.exe, the problem is when the app closes down, it leaves the parent process in place, and only ascshell.exe closes. So I cannot do a check on the parent because it will always be there. Thanks |
||||||||
|
|
|||||||
Try: Code:
Note the location of single vs double quotes. Replace "My_Proc" with your process name, or a variable. If using NoVarsInStrings, it would be "' + $Var + '" to preserve the quotes. Glenn |
||||||||
|
|
|||||||
PSList only shows parent processes. Thanks Anyhow. Rich |
||||||||
|
|
|||||||
You can enumerate the threads from "Win32_Thread" and link back to the parent process using ProcessHandle - Hurrah Unfortunately the "Name" and "Caption" fields are empty, so it is not possible to identify the thread - Boo |
||||||||
|
|
|||||||
I am glad in a funny way that no one has solved this problem. Thanks guys for your help, but this problem may have to be left unsolved. Thanks |
||||||||
|
|
|||||||
how about this as an endaround... enum all PIDs before starting the install/app and dump into an array start the app enum the PIDs again discarding the ones that exist in the first array then you can discard the ones with processnames not what you are looking for it is a definite kludge.. but you may get what you are looking for |
||||||||
|
|
|||||||
Have your tried PrcView? There is a windows version and a command line version. Quote: |
||||||||
|
|
|||||||
Thanks Al will look at that. Rad. The problem with this Pharmacy Application is that when you start your computer, no process is open for the App. But when you start the app for the very 1st time, One Parent process opens and 3 Child Processes opens. When you close down the app, only one of the child processess closes. Thanks |
||||||||
|
|
|||||||
eh? why an problem? I saw no problem with rads suggestion about this. |
||||||||
|
|
|||||||
Ok. An explanation. When you start old (16 bit) apps the operating system creates a safe environment to execute them in, and a process to do the thunking. These are your NTVDM and WOWEXEC threads. Your application is started as another thread within the NTVDM process. When you start another 16 bit app, it uses the existing NTVDM process (and WOWEXEC) to save memory. When you close your 16 bit app, the OS may decide to leave the NTVDM process hanging around in case you start another one. Now, I can think of a way of enhancing Rads suggestion to make it work for you. Before I start on something that will take a while to put together, why don't you take a step back and explain exacly what it is you are trying to do, and why? It may be that there is a far simpler way of doing it - looking for window titles, open files/shares etc. |
||||||||
|
|
|||||||
As it was an interesting challenge, here is an example of how to do it. This takes Rads method a little further, to cater for the wrinkles I've talked about in the previous post. The process finds all the active NTDVM process headers, and then identifies all the threads in the processes. It then starts the Win16 application, and checks for all the threads again, recording any new ones. Finally, it monitors the "new" threads, and exits with a message when one of them closes.
Code: Break ON |