06-24-2013 03:37 PM
I have a batch file that needs to be executed on a remote computer.
I can call psexec.exe using the system exec vi and the the command executes remotely as expected.
The problem is that the system exec vi hangs if the Wait Until Completion is true.
I can set this to false but then I don't get the std out or std error so I can't do capture any error codes.
What is the labview vi waiting for that is preventing it from finishing?
07-18-2013 04:04 AM
Hi,
If your program normally exits as a MsDos program does the exec.vi should also stop.
What happens if you run your psexec.exe program in a MsDos environment ?
Kees
07-18-2013 07:38 AM
Psexec is a Microsoft add-on utility that can copy an exeutible file to a remote machine and run it there.
Not sure what you mean by DOS envoronment but when I run this from the Windows Start command or from a CMD window (using the -d option) it exits normally.
What I ended up doing is adding lines to the remotely executed batch file that capture standard out and standard error and save to a file on the network. Then I can read that and search for "task complete" strings and/or errors.
Reseaching Psexec, I find that it outputs std error and std out in a strange way that causes similar issues when called from other languages.
There are alternative programs out there that do not have these limitations. (PowerShell, RemoteExec, and BeyondExec for example)
07-19-2013 02:03 AM
Hi,
I think you have to be old to know what MsDos is
I had similar problem in the past and I used the same solution as you do. Capture the output in a file and check the file. Not the solution you want but it works.
Some programs exit in a strange way which are not handled by the exec.vi as you migth expect.
Kees