Thanks folks, Here are a couple of clarification points - 1. I am not using tramp 2. The usecase is as follows - I need to ssh into a server where I manipulate a file and then I have to scp the file into a local machine that requires me to enter password. I need to repeat this a number of times - but each time, its the same file so, essentially I just have to re-execute the same scp command - scp file localmachine:/path .... I'd like to record the copying action into a keyboard macro that I can playback. I'd like to be able to solve it with just emacs - I mean, this situation is really common for me so it would be great if I could get a plain vanilla emacs solution to this. Regards, Kashyap