<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Michael and Ludo,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">You were both spot on, that's what it was.</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks guys.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Rich</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 8 August 2013 07:45, Ludo Brands <span dir="ltr"><<a href="mailto:ludo.brands@free.fr" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=ludo.brands@free.fr&cc=&bcc=&su=&body=','_blank');return false;">ludo.brands@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 08/08/2013 08:02 AM, Richard Mace wrote:<br>
> Hi All,<br>
> I am baffled :)<br>
> If I open a command prompt, change to the directory which contains<br>
> plink.exe and run the command:<br>
><br>
</div>> plink -pw password <a href="mailto:root@192.168.0.5" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=root@192.168.0.5&cc=&bcc=&su=&body=','_blank');return false;">root@192.168.0.5</a> <mailto:<a href="mailto:root@192.168.0.5" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=root@192.168.0.5&cc=&bcc=&su=&body=','_blank');return false;">root@192.168.0.5</a>> command<br>
<div class="im">><br>
> The command works no problem, but if I do following in a TProcess I get<br>
> a "flash" of a black window, then nothing!<br>
><br>
> Process := TProcess.Create(nil);<br>
> try<br>
> sPSFTPFile := IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)))<br>
> + 'plink.exe';<br>
> Process.Executable := sPSFTPFile;<br>
> S := '-pw ' + Password + ' ' + Username + '@' + IPAddress + ' ' +<br>
> Command;<br>
><br>
> Process.Parameters.Add(S);<br>
> Process.Options := Process.Options + [poWaitOnExit];<br>
> Process.Execute;<br>
> finally<br>
> Process.Free;<br>
> end;<br>
><br>
> Any ideas?<br>
><br>
><br>
</div>You need to split the parameters. Parameters are the equivalent of<br>
paramstr() or argv on the receiving end. So something like:<br>
<br>
Process.Parameters.Add('-pw');<br>
Process.Parameters.Add(Password);<br>
Process.Parameters.Add(Username + '@' + IPAddress);<br>
Process.Parameters.Add('<mailto:<a href="mailto:root@192.168.0.5" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=root@192.168.0.5&cc=&bcc=&su=&body=','_blank');return false;">root@192.168.0.5</a>>');<br>
Process.Parameters.Add(Command);<br>
<br>
Ludo<br>
<br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=Lazarus@lists.lazarus.freepascal.org&cc=&bcc=&su=&body=','_blank');return false;">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</blockquote></div><br></div></div>