Putty and commands
Posted: Tue Jun 19, 2007 2:24 pm
I'm executing putty from a Windows application.
So far I have constructed this command line, which loads putty up no problems.
I want to execute a remote command but I assume I need to use some kind of putty script or can I just add the command to the list of switches?
According to the docs, there is an option:
Problem is, it appears to be a file stored in the local machine, when I referenced a file on the server PUTTY complained, when I brought that into the same CWD as putty.exe (Windows version) all went fine, but no commands appear to execute and the console window closes immediately.
So I'm not sure I understand how this whole thing comes into play. When using the Windows version of PUTTY.exe and I use a remote command/script obviously the commands are intended for the remote device (this case Linux) so commands like
Should be passed to the remote command line, no???
Anyone have any experience using putty through command line and executing arbitrary commands on the remote machine? What am I doing wrong?
Cheers
So far I have constructed this command line, which loads putty up no problems.
Code: Select all
putty.exe -ssh hockey@192.168.1.103 -pw passwordAccording to the docs, there is an option:
Code: Select all
-m: read a remote command or script from a fileSo I'm not sure I understand how this whole thing comes into play. When using the Windows version of PUTTY.exe and I use a remote command/script obviously the commands are intended for the remote device (this case Linux) so commands like
Code: Select all
ls, rm, cp, etcAnyone have any experience using putty through command line and executing arbitrary commands on the remote machine? What am I doing wrong?
Cheers