2010-09-15 69 views
1

我使用的Plink執行遠程命令:問題執行砰砰(膩子)命令

當使用這種從命令提示符在一行中它亙古不變的工作:

C:\>c:\plink.exe -l userId -pw psw -m C:\goto\test.bat remote_host 

它說無法打開命令文件「C:\轉到\ test.bat的」

但以下工作:

C:\>c:\plink.exe -l userId -pw psw remote_host 
C:\>C:\goto\test.bat 

請HEL頁。

+0

這是否使用SSH協議?你有在這個窗口上運行的SSH服務器嗎? – LatinSuD 2010-09-15 19:22:34

+2

這不是一個superuser.com問題嗎? – jlafay 2010-09-23 17:21:39

+0

@jlafay:我這麼認爲,但似乎沒有可能投票「關閉」它,因爲它有獎金。 – 2010-09-30 11:40:17

回答

2

嘗試運行它像這樣:

c:\plink.exe -l userId -pw psw remote_host C:\goto\test.bat 
+0

goto是遠程蝙蝠的路徑。 – user234194 2010-09-15 19:54:01

+0

所以你說C:\ goto \ test.bat在遠程機器上?如果是這樣,你需要運行:'c:\ plink.exe -l userId -pw psw remote_host C:\ goto \ test.bat'。 -m標誌用於plink從本地文件讀取遠程命令。 – dogbane 2010-09-15 19:55:33

+0

您應該編輯您的答案以包含評論的最終解決方案。 – Darron 2010-09-30 13:31:11

1

通過some documentation來看,這應該工作:

C:\>c:\plink.exe -l userId -pw psw remote_host C:\goto\test.bat 
1

這爲我工作:

Call \\LocalServerName\plink.exe -pw PASSWORD -m D:\FOLDER\FILE.exe [email protected] 

或者,如果其本地電腦:

Call c:\Folder\plink.exe -pw PASSWORD -m D:\FOLDER\FILE.exe [email protected] 

上限 - 將其更改爲你的國家