05-02-2018 02:16 AM
I have application, which will run commands over plink.exe using syste Exec.
We are facing below issue if we run the application on win 7.
Note: the same command works in cmd prompt on both pc win7 and win10
To show the error I have created the system exec.vi exe and executed command on both pc.
Below are the response please find snap shot.
Can you please help.
Windows 7 PC:
Windows 10 PC:
05-02-2018 02:59 AM
Can you run a basic command using System Exec under Windows 7? Something like C:\Downloadables\plink.exe without any other arguments. If this works, your command line might need tweaking.
You might try putting cmd /c at the start of the command line string, so it then reads cmd /c C:\Downloadables\plink.exe ....
05-02-2018 03:12 AM - edited 05-02-2018 03:15 AM
Hi,
I tried up to C:\Downloadables\plink.exe without arguments it is working fine. but if i add any arguments
"C:\Downloadables\plink.exe -ssh LTEhw@10.10.10.99 -pw welcome_1234" it is giving the handle is invalid.
even in tried putting cmd /c also same error.
05-02-2018 03:32 AM
This thread seems to be about the same issue you're having with System Exec and plink. One possible solution mentions setting the 'wait until completion?' flag to false.
It seems like this is an issue with plink itself. There's a lengthy thread on a Microsoft forum discussing the issues of running plink and redirecting stdin. There might be some useful info in there.
05-02-2018 03:47 AM
I can't set wait until completion to flag to false, I need the cmd processed data to perform other operations.
I think it something with labview issue.. because in cmd prompt i can able to run the same command and get response.
and in windows 10 pc the same application can able to run.
05-02-2018 05:56 AM - edited 05-02-2018 05:59 AM
@vikram100 wrote:
I can't set wait until completion to flag to false, I need the cmd processed data to perform other operations.
I think it something with labview issue.. because in cmd prompt i can able to run the same command and get response.
and in windows 10 pc the same application can able to run.
Your own observation would indicate something else! The variable between working and non-working in this is the Windows version, not LabVIEW. So apparently something in the process creation in Windows was changed to allow it to work with the type of broken standard IO handling that plink.exe does. Or for some reasons the password parameters are used correctly in plink when run on your Windows 10 system (with Windows 10 not necessarily having to be the factor that makes it work) while plink decides that it can not work with them on your other system and tries to prompt for the right password, but since System Exec does not allow interactive standard IO redirection you never see that password request.
The post from Michael Balzer would support that idea, as there seems to be a known problem with starting plink with password credentials passed over the command line as parameters. This seems not to be implemented in a way that always works properly, so the workaround mentioned is to use public-key authentification instead.
05-02-2018 06:11 AM
What if you make the command a bat-file and run that instead?
/Y
05-11-2018 12:47 AM
I tried with batch files also it is the same response.