Switching between two users

Can any one tell me :
How we can switch between two users without prompting for the password. (In the SHELL SCRIPT can we fetch the USERID and PASSWORD from a specified file, without using SUDO command)?

it is not possible. Or you can use some tools like "expect" to enter password inside the scripts.

Thanks will check that.