LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 02-02-2011, 06:13 AM   #1
nirmal.mukundan
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Batch file to login to putty


Hi All,

I've created a .bat file with this line:
start C:\USERS\Putty\putty.exe -ssh user@server.com -pw password

That opens a putty session and logged in it with the user and password i've already specified. But now, I want to enter a simple command like "ls -l" for example.. How can I do that?

I've also tried plink...The line in that case is this one:
start C:\USERS\Putty\plink.exe -v -ssh user@server.com -pw password -m UNIX_commands.txt

and in that file "UNIX_commands.txt" I've added the following lines:

cd /projects/test
ls -l

all works fine (the commands are executed) but i can't see the putty session... all i can see is the verbose in my DOS windows of the last line "ls -l"...

The putty session vanishes away. How can I have the session opened and list the mentioned directory.

Please help

Regards
Nirmal
 
Old 02-02-2011, 08:50 AM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Continue here: http://www.linuxquestions.org/questi...-putty-860182/
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to login to server thru console but able to login via network using putty maxy7710 Linux - Newbie 6 03-02-2022 02:42 AM
Batch file to login to putty nirmal.mukundan General 3 02-08-2011 02:52 PM
how can i enter unix commands in a putty session--> thru batch programming skipper_penguin Linux - General 2 06-19-2009 02:40 PM
putty ssh batch zerocool22 Linux - Networking 8 06-19-2009 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration