LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec command working in win10 and not working in Win7

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:

 Win7.jpg 

 

 

Windows 10 PC:

 Win10.jpg

0 Kudos
Message 1 of 8
(4,761 Views)

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 ....




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 2 of 8
(4,743 Views)

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.

0 Kudos
Message 3 of 8
(4,735 Views)

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.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 4 of 8
(4,728 Views)

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.

0 Kudos
Message 5 of 8
(4,716 Views)

@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.

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 8
(4,697 Views)

What if you make the command a bat-file and run that instead?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 8
(4,691 Views)

I tried with batch files also it is the same response.

0 Kudos
Message 8 of 8
(4,591 Views)