Script to automatically enter a password

I need to retrieve thousands of lines of information from hundreds of nodes. Each node requires a passowrd in order to retrieve the information. Fortunately, the password is the same for each one of them. So I am trying to come up with a script that would allow me to include the password so I can query desired info from many nodes at once.
Let's say for example that I want to to list all the alarms on one node, I would write:
ls
Please enter your password (the system would ask me to enter my password)
Let's say that the password is abc
Now if I want to get data for 20 nodes, I would write:
batch list ls (list is a file that contains the list of all the nodes I am interested in). 
Since the password is the same for all the nodes, how can I write a script that would automatically include my password so I can retrieve all the info at once? 
I hope this is clear enough.
Thank You