Connect to Server B from Server A and Archive the file

Hi

I need to connect to a ServerB from Server A
eg: Server A : 172.20.273.51, un: xxx, pwd: xxx
Server B: 172.20.273.51, un:yyy, pwd: yyy

Need to copy the files\(with name starts with IME*\) from /grid/pc/IME* 
to /grid/pc/archive
What will be the command or script to do the above process   without prompting the passowrd.

Thanks in advance
Sheku

using expect you can do this . I have given a basic script. Change the variables username passwd as per ur setting and give try.

#!/usr/bin/expect
spawn telnet 172.21.149.155
  expect "login:"  
  send username\r
  expect "password:"
  send password\r
  expect "$"  
  send "copy /grid/pc/IME* /grid/pc/archive\r"
  expect "$"  
  send exit\r
  expect eof

---------- Post updated at 05:31 AM ---------- Previous update was at 05:28 AM ----------

#!/usr/bin/expect
spawn telnet 172.20.253.112
  expect "login:"  
  send cipxxx\r
  expect "password:"
  send sp144\r
  expect "$"  
  send "copy /dw/cdrsp/stage/velocity/rtf/input/SOH/dev/ISM_VME* 

/dw/cdrsp/stage/velocity/rtf/input/SOH/dev/archive\r"
  expect "$"  
  send exit\r
  expect eof

---------- Post updated at 05:43 AM ---------- Previous update was at 05:31 AM ----------

Please some help me. Its very urgent!

the script can have any name

say you have archive.ksh

You can run it from your present location

$./archive.ksh

Or place the script in any of your PATH location.