Index: Lib/distutils/command/install_scripts.py =================================================================== --- Lib/distutils/command/install_scripts.py (revision 66723) +++ Lib/distutils/command/install_scripts.py (working copy) @@ -10,7 +10,9 @@ __revision__ = "$Id$" import os +import sys from distutils.core import Command +from distutils.spawn import find_executable from distutils import log from stat import ST_MODE @@ -56,6 +58,17 @@ mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777 log.info("changing mode of %s to %o", file, mode) os.chmod(file, mode) + elif os.name == 'nt': + # Add .bat files for scripts without executables + for file in self.get_outputs(): + name = os.path.splitext(os.path.basename(file))[0] + if not find_executable(name, path=self.install_dir): + executable = "%s.bat" % os.path.join(self.install_dir, name) + log.info("writing script executable %s", executable) + bf = open(executable, "wb") + bf.write("@%s %s %s\r\n" % (sys.executable, file, + "%1 %2 %3 %4 %5 %6 %7 %8 %9")) + bf.close() def get_inputs (self): return self.distribution.scripts or []