Info Node: (efaq)Problems with Shell Mode on MS-Windows
(efaq)Problems with Shell Mode on MS-Windows
Why do I get an error message when I try to run `M-x shell'?
============================================================
On MS-Windows, this might happen because Emacs tries to look for the
shell in a wrong place. The default file name `/bin/sh' is usually
incorrect for non-Unix systems. If you know where your shell
executable is, set the variable `explicit-shell-file-name' in your
`.emacs' file to point to its full file name, like this:
(setq explicit-shell-file-name "d:/shells/bash.exe")
If you don't know what shell does Emacs use, try the `M-!' command;
if that works, put the following line into your `.emacs':
(setq explicit-shell-file-name shell-file-name)
Some people have trouble with Shell Mode because of intrusive
antivirus software; disabling the resident antivirus program solves the
problems in those cases.