3

I am trying to use Emacs 24.2 with Tramp on windows 7 to remotely edit files on a linux server. I installed the Putty suit program and OpenSSH. I also placed the plink.exe in the putty suit into the bin folder under the emacs 24 folder, and added the folder emacs24/bin into the PATH environment variable.

However, when I try to access the remote file from emacs with the command in the minibuffer: /username@host:filename, I get the following error message from emacs: plink is not recognized as an internal or external command. It seems that emacs cannot find the plink program. But, when I try to run plink in windows cmd, it can find the plink program. Also, I can ssh to the remote server in windows cmd.

Can anyone tell me what's my problem? Do I need to install cygwin to make it work? Thanks a lot.

Hao
  • 41
  • 3

2 Answers2

1

To get tramp with plink to work, I had to add my PuTTY path to my system search path.

On Windows 10: control panel >> System & Security >> System >> advanced system settings >> enviroment variables

To PATH I appended the PuTTY path: C:\Program Files (x86)\PuTTY

I'm guessing the key is that from PowerShell or the command prompt, you need to be able to run plink without specifying the path.

bjerre
  • 109
  • 3
0

I was able to resolve this and I did not have to install cygwin.

Try adding the path where putty was installed to your exec-path variable in emacs. Execute the following elisp code in emacs or put it in your .emacs file. Make sure the slashes are forward, not backslashes, as Emacs and Windows use different conventions.

(add-to-list 'exec-path "C:/Program Files (x86)/PuTTy")

check what exec-path is set to by typing C-h v exec-path

  • 1
    I tried emacs24 on windows 7. I did what you said above, but it does not solve my problem. – michael Mar 09 '14 at 09:33
  • Did you install putty using the Windows installer `putty-0.63-installer.exe`? (I did to make sure everything was installed) Is the path to putty in the exec-path list, did you put the `add-to-list` line above in your .emacs file? You can check/edit the emacs exec-path list by running `M-x customize-variable exec-path`. – Matt Cascardi Mar 11 '14 at 05:09