Catch the output of PLINK.exe (PUTTY)

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Catch the output of PLINK.exe (PUTTY)

Post by highend »

Maybe because of that. I have 850. PeterH, your codepage is?

Edit: Yes, that seems to be the reason...

When I execute it from a system with CP 437 -> No output
Switching back to 850 + restart -> Works
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Catch the output of PLINK.exe (PUTTY)

Post by LittleBiG »

It seems it is not related only to plink. This doesn't provide anything either:
text runret("cmd /c chcp", <curpath>);
These give the active codepage correctly:

Code: Select all

run "cmd /k chcp", <curpath>;

Code: Select all

run "cmd /c chcp >result.txt", <curpath>;
I have no choice but:
To see the attached files, you need to log into the forum.

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Catch the output of PLINK.exe (PUTTY)

Post by highend »

Works fine on a german system with CP 850 :)
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Catch the output of PLINK.exe (PUTTY)

Post by LittleBiG »

Codepage 852, doesn't work either.

admin
Site Admin
Posts: 66672
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Catch the output of PLINK.exe (PUTTY)

Post by admin »

LittleBiG wrote:It seems it is not related only to plink. This doesn't provide anything either:
text runret("cmd /c chcp", <curpath>);
These give the active codepage correctly:

Code: Select all

run "cmd /k chcp", <curpath>;

Code: Select all

run "cmd /c chcp >result.txt", <curpath>;
I have no choice but:
Ha, love it!

Gonna check that codepage issue...

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Catch the output of PLINK.exe (PUTTY)

Post by PeterH »

Sad to say: my CP is 850

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Catch the output of PLINK.exe (PUTTY)

Post by PeterH »

And also sad to say: not better with v0010.

By the way: the reason can't be the color codes: if I execute "help" no color codes are returned, but runret() still returns "".

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Catch the output of PLINK.exe (PUTTY)

Post by LittleBiG »

text runret... is still empty. :-(

PeterH, have you tried the simple

Code: Select all

text runret("cmd /c chcp", <curpath>);
without any Linux involved?

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Catch the output of PLINK.exe (PUTTY)

Post by PeterH »

LittleBiG wrote:text runret... is still empty. :-(

PeterH, have you tried the simple

Code: Select all

text runret("cmd /c chcp", <curpath>);
without any Linux involved?
Missed that one (here an emoticon for sleeping, instead: :ghost: )

You are right: returns "".
It seems Don sees this, too?

admin
Site Admin
Posts: 66672
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Catch the output of PLINK.exe (PUTTY)

Post by admin »

Next beta try this, it will return a hex dump of the raw data in the pipe:

Code: Select all

text runret("cmd /c chcp", , 1);

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Catch the output of PLINK.exe (PUTTY)

Post by highend »

With the wrong codepage (437) it still returns nothing...

Code: Select all

text quote(runret("cmd /c chcp", , 1));
chcp.png
While on 850 it works fine:
chcp1.png
To see the attached files, you need to log into the forum.
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66672
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Catch the output of PLINK.exe (PUTTY)

Post by admin »

Well, at least I know now that my own code is not the culprit. Either it's a somehow wrong API call, or Windows itself has an issue here. Needs deeper research. After the weekend... :beer:

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Catch the output of PLINK.exe (PUTTY)

Post by LittleBiG »

Code: Select all

text runret("cmd /c chcp", , 1);
gave back nothing. Not even "". DOS Codepage 852 (OEM Latin II).

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Catch the output of PLINK.exe (PUTTY)

Post by highend »

Not even ""
Without quote()? xD
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Catch the output of PLINK.exe (PUTTY)

Post by LittleBiG »

highend wrote:
Not even ""
Without quote()? xD
yes, without. :-)

Post Reply