Issue with running commands from shell script

I'm trying to copy files from a remote windows server to Unix server. I was successfully able to copy files from windows server using command prompt but when I run these commands from a script it's not working as expected. commands used:

  sftp user@remoteserver.com
  lcd local_dir
  cd remote dir
  get file_name
  exit

When I run these commands from a script the script is stopping after it connects to the remote server.

Connected to remote server
sftp>

Can anybody tell me how to fix this issue.

Why not use scp? All those lines can be reduced to a single line.

scp local_dir/file_name  user@remoteserver.com:/remote_dir/.

I tried scp earlier and getting the following error.

exec request failed on channel 0

What is your system?