在后台运行PuTTY -m(不需要窗口) [英] Running PuTTY -m in background (no window wanted)

查看:825
本文介绍了在后台运行PuTTY -m(不需要窗口)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用系统命令(Windows 7)从Perl脚本运行PuTTY.我使用-m命令行选项,效果很好,但是我不希望弹出窗口.这是一个短暂的会话,因此将窗口打开一秒钟以建立连接然后关闭很烦人.

I am running PuTTY from a Perl script using the system command (Windows 7). I use the -m command line option and it works great, but I do not want a window popping up. It's a short lived session, so it is annoying having the window open up for a second to make the connection and then close.

我搜索了"windows背景" "putty背景" 和许多其他变体.我靠近了但没有雪茄.线程运行腻子作业... MATLAB"非常接近,但是我已经在这样做了.

I searched "windows background" "putty background" and many other variations. I got close but no cigar. The thread "Run putty jobs...MATLAB" Was oh so close, but I was already doing that.

推荐答案

您不能使PuTTY不显示其窗口.参见腻子希望没有终端窗口.

You cannot make PuTTY not show its window. See PuTTY wish no-terminal-window.

尽管您可以改用Plink. Plink是PuTTY套件中的工具,具有与PuTTY相同的功能和命令行参数(包括-m).但是与PuTTY相反,它是一个控制台应用程序.因此,当您从Perl脚本运行它时,它将继承Perl控制台窗口.它不会自己打开.

Though you may use Plink instead. The Plink is a tool from PuTTY suite, with the same functionality and command-line arguments as PuTTY (including the -m). But contrary to PuTTY, it is a console application. So when you run it from your Perl script, it will inherit the Perl console window. It won't open its own.

请参见使用命令行连接工具Plink .

请注意,Plink支持在命令行上指定命令,因此您实际上可以避免为-m开关使用临时文件:

Note that the Plink supports specifying a command on its command line, so you can actually avoid using a temporary file for the -m switch:

plink.exe -ssh user@example.com "command"

这篇关于在后台运行PuTTY -m(不需要窗口)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆