0

我的桌面上有 putty.exe,所以如果我转到命令提示符然后 C:\Documents and Settings\user\Desktop定位并执行以下命令,它将启动 telnet 连接到指定服务器的 Putty 窗口:

putty.exe telnet://a.b.c.d/

我正在尝试使用以下命令将腻子启动到 telnet 到特定服务器,但它对我不起作用:

<?php
$securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe telnet://a.b.c.d/ ";


exec($securecrt);
?>

If I try following then it launches the putty application but will have to provide the host name or IP to login:

<?php
$securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe ";


exec($securecrt);
?>

不确定我是否遗漏了一些非常基本的东西,如果有人可以帮助解决这个问题,那就太好了。

4

1 回答 1

0

您可以尝试将 PHP 与 fsock 一起使用,或者使用类似http://www.geckotribe.com/php-telnet/的类,而不是使用 Putty

但是,您可以使用当前设置尝试以下操作:

$securecrt = '"C:\Documents and Settings\user\Desktop\putty.exe" telnet://a.b.c.d/';
于 2012-07-05T18:31:42.430 回答