1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 02:19:04 +00:00
Files
nmap/mswin32/python-wrap.bat
david 7f3effda4a o [Ndiff] Ndiff is now included in the Windows zip distribution. For
space reasons, it is not an executable compiled with py2exe as in
  the executable installer, rather it is the Ndiff source code
  (ndiff.py) and a batch file wrapper (ndiff.bat). Because it's not
  precompiled, it's necessary to have a Python interpreter
  installed. [David]
2009-02-04 22:48:21 +00:00

36 lines
871 B
Batchfile
Executable File

@echo off
rem This batch file searches for a Python interpreted and uses it to run a
rem script. It displays an error message if not Python is found. The script
rem to run must have the same filename as the batch file, with an extension of
rem .py rather than .bat.
setlocal
rem %0 is the name of the batch file. "dpn" means drive, path, filename
rem (excluding extension).
set PROG=%~dpn0.py
if not exist "%PROG%" (
echo Cannot run %PROG%
echo because that file does not exist.
exit /B 1
)
set PATH=%PATH%;C:\Python26;C:\Python25;C:\Python24
for %%P in ( python.exe ) do set PYTHON=%%~f$PATH:P
if not exist "%PYTHON%" (
echo Cannot run %PROG%
echo because python.exe was not found anywhere in
echo %PATH%.
echo.
echo To run this program, download and install Python from
echo http://www.python.org/download.
exit /B 1
)
"%PYTHON%" "%PROG%" %*
endlocal