1

My emacs.bat rest in the same bin directory as emacs.exe. This directory is included in the PATH variable (Windows).

Content of emacs.bat:

@echo off "%~dp0emacsclientw.exe" -na "%~dp0runemacs.exe" "%1"

However, whenever I use this command, emacs.exe gets executed instead of the .bat file. How would I go about fixing this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

3

It seems you could put the emacs.bat in another directory and place that directory earlier in the PATH. Note: if you were to run "emacs" while in the directory containing emacs.exe then the .exe would take precedence.

Edit: Alternatively, you could just type emacs.bat instead of emacs at the command prompt.

Edit 2: As seen in this Answer, you could set the PATHEXT environment variable. Something along the lines of:

PATHEXT=.BAT;.COM;.EXE;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.RB;.RBW

Community
  • 1
  • 1
akTed
  • 214
  • 2
  • 8
  • I have to modify .bat a little but it works like a charm. Simple solution indeed. Thanks, – user1970791 Jan 14 '13 at 03:08
  • You're welcome, @user1970791. Note "Edit 2" that I put in my Answer after you accepted it. That might be a better solution for you. – akTed Jan 14 '13 at 03:12