07-01-2024 05:29 PM
I am trying to programmatically check to see if a program is running and then save that result to a file to do some post processing on. I can get this to work via the command line (cmd.exe). If I issue the command tasklist | Find "svchost.exe" > fg.txt it checks to see if that process is running and places the results into a fg.txt file. I try to use this concept thru the call executable in test stand and although it seems to run nothing gets written to the file. Here is a snippet of that code any help would be appreciated.
07-01-2024 05:31 PM
the file pathname is correct in the above snippet. It should be going to cmd.exe it was appended accidentally when I was doing the snippet.
07-01-2024 08:49 PM
So the issue is with the argument expression but not sure the issue..
07-02-2024 12:52 AM
How about using the .net version?
07-02-2024 05:01 AM
Thanks for your help. I tried what you suggested and it works great. Is there a .net call where I can also start a program that is on the hard drive if I give it the path of the program that I want to open? I would like to do everything in .net if possible.
07-02-2024 07:15 AM
You may wanna look into
https://learn.microsoft.com/de-de/dotnet/api/system.diagnostics.process.start?view=netframework-4.8
and
in case you are usually doing LabVIEW programming, you might find the following thread helpful picture-wise