tags:

views:

140

answers:

2

I am using Plink to execute remote command:

When using this from cmd prompt in single line it doesnot work:

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

It says unable to open command file "C:\goto\test.bat"

But The following works:

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

Please help.

+2  A: 

Try running it like this:

c:\plink.exe -l userId -pw psw remote_host C:\goto\test.bat
dogbane
goto is the path of the bat located remotely.
So you're saying that C:\goto\test.bat is on the remote machine? If so, you need to run: `c:\plink.exe -l userId -pw psw remote_host C:\goto\test.bat`. The -m flag is for plink to read remote commands from a local file.
dogbane
@fahd: you should edit your answer to include the final solution from your comment.
Darron
+1  A: 

Judging by some documentation, this should work:

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