1

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.

3
  • Does that use SSH protocol? Do you have an SSH server running on that windows? Commented Sep 15, 2010 at 19:22
  • 2
    Isn't this a superuser.com question? Commented Sep 23, 2010 at 17:21
  • @jlafay: I think so, but it doesn't seem like it's possible to vote to "close" it since it has a bounty. Commented Sep 30, 2010 at 11:40

3 Answers 3

2

Try running it like this:

c:\plink.exe -l userId -pw psw remote_host C:\goto\test.bat
Sign up to request clarification or add additional context in comments.

3 Comments

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.
you should edit your answer to include the final solution from your comment.
1

Judging by some documentation, this should work:

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

Comments

1

This has worked for me:

Call \\LocalServerName\plink.exe -pw PASSWORD -m D:\FOLDER\FILE.exe USER@REMOTESERVER

Or if its a local computer:

Call c:\Folder\plink.exe -pw PASSWORD -m D:\FOLDER\FILE.exe USER@REMOTESERVER

Caps - Change it to your state

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.