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?

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

I have to modify .bat a little but it works like a charm. Simple solution indeed. Thanks,
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.