LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to programmatically send a response to a program called with system exec?

I am trying to run pscp, a Putty utility, to send a file to a Linux box from a test PC. The problem is this machine will be testing many different units. With each unit there will be a different RSA key that is used for authentication. When I send the command I am prompted to accept the key y or n. Is there a way to implement this with the system exec? After a key is pressed the transfer does fine. It is getting past the key authentication that is the problem. Any help would be greatly appreciated.

 

Troy

0 Kudos
Message 1 of 4
(3,347 Views)
What type of prompt is this? Is it a dialog box or are you supposed to press a key on the keyboard? For either method you need to make the window active which you can do with the Windows API and the lvwutil library you can find here. At that point what you do depends on whether you have a dialog or you need to press a key. For a dialog you need to simulate pressing a button which you can also do with the Windows API. For the keyboard same idea. You can also do this with AutoIt, which doesn't require Windows API programming and has a relatively simple ActiveX interface.
Message Edited by smercurio_fc on 09-10-2008 03:12 PM
Message 2 of 4
(3,337 Views)

Hi Troy,

 

Unlike scp on Linux, pscp accepts input from stdin. I think that passing cmd /c "echo y | pscp args..." to the system exec VI will get you past the trusted host prompt.


Brad

---
Brad Keryan
NI R&D
Message 3 of 4
(3,300 Views)
Thanks you guys for the help. I am trying all methods to see the best fit.
0 Kudos
Message 4 of 4
(3,263 Views)