how to do Putty SSH Auto-Login and Run Command File
        Posted  
        
            by 
                supportpb
            
        on Super User
        
        See other posts from Super User
        
            or by supportpb
        
        
        
        Published on 2012-12-06T05:54:59Z
        Indexed on 
            2012/12/06
            11:10 UTC
        
        
        Read the original article
        Hit count: 333
        
I am using the follwing to auto login and then run file containng a command.
C:\path\to\putty.exe -load "[Sessionname]" -l [user] -pw [password] -m C:\path\to\commands.txt
Commands.txt contains the following command
ps -elf|grep 'sometext'
but when I try to do so a new window for putty comes and exits instantly after login. I cannot see the output of command in commands.txt
What is the problem;. Is there error in my approach or I need some more command to make the putty window pause for sometime before exiting.
© Super User or respective owner