Technext Posted May 25, 2010 Report Share Posted May 25, 2010 Hi,I am using Plink to access remote server. I want to run few commands on the remote server. Though I am able to connect to the remote machine, I am not able to run any command.The following works:---------------------------------------------------plink -ssh -l %user_name% -pw %user_pwd% %machine%---------------------------------------------------The following doesn't:-------------------------------------------------------------------plink -ssh -l %user_name% -pw %user_pwd% %machine% "cd e:\data"-------------------------------------------------------------------Can anyone please tell me how to do 'cd' on a remote box using plink? Obviously, I want to run few other commands as well after doing 'cd' operation.Regards,GC Quote Link to comment Share on other sites More sharing options...
Technext Posted June 30, 2010 Author Report Share Posted June 30, 2010 Hi,I have finally been able to run command on remote machine using Plink. The problem was with the syntax. It now works both by passing the command as argument, and by using the ‘–m file’ option provided with Plink. For example,plink -ssh -pw xxx gaurav.chhabra@server cd c://sample//gc//plink -ssh -pw xxx gaurav.chhabra@server –m file.txtwhere ‘file.txt’ contains:cd c://sample//gc//I am able to run executables and commands such as cd, mkdir. The only issue that I am now having is that, I am not able to run commands such as move, rename etc.For example,---------------------------------------------------------------------------------------------plink -ssh -pw xxx gaurav.chhabra@server move c://sample//gc//file.txt c://test//move: not found---------------------------------------------------------------------------------------------Any idea what the problem might be?Thanks,GC Quote Link to comment Share on other sites More sharing options...
MANEMAN Posted July 17, 2010 Report Share Posted July 17, 2010 move: not found - Any idea what the problem might be?Almost certain that it is a syntax error. You would have to give a lot more details for anyone to to give the time and space to go deep into your problem, as most of the people on the forum are just normal family people having to get tea ready, walk the dog, beat the kids, and then get up ready to go to work the next morning. :( Take your luck, and just hope that someone is interested enough to answer your problem, and polish your ego.How helpful did you find my replies to your recent post ? - http://forums.windowsforum.org/index.php?showtopic=45698John. Quote Link to comment Share on other sites More sharing options...
Technext Posted July 22, 2010 Author Report Share Posted July 22, 2010 Hi John,First of all, my sincere apologies for the delay in reply!As far as posting more information is concerned, I want to mention that I am not lazy. :) It's just that I couldn't think of anything else to mention in my post. By the way, I usually set 'Instant Notification on Replies' on every forums that I visit; looks like I missed setting it on this forum.Anyways, thanks for your time. I have finally got a solution to my issue.plink -ssh -pw xxx gaurav.chhabra@server cmd.exe /c move c://sample//gc//file.txt c://test//Thanks & Sorry again,GC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.