33 lines
1.0 KiB
Batchfile
33 lines
1.0 KiB
Batchfile
echo off
|
|
|
|
rem check for python presence
|
|
python --version 2>NUL
|
|
if errorlevel 1 goto NOPYTHON
|
|
goto P2
|
|
:NOPYTHON
|
|
python3 --version 2>NUL
|
|
if errorlevel 1 goto NOPYTHON3
|
|
|
|
cd root
|
|
echo.
|
|
echo ***********************************************************************************************
|
|
echo * Launching Python 3 HTTP File Server, close this windows or use Ctrl-Brk to close the server *
|
|
echo ***********************************************************************************************
|
|
echo.
|
|
python3 ..\server.py
|
|
goto :EOF
|
|
|
|
:P2
|
|
cd root
|
|
echo.
|
|
echo *********************************************************************************************
|
|
echo * Launching Python HTTP File Server, close this windows or use Ctrl-Brk to close the server *
|
|
echo *********************************************************************************************
|
|
echo.
|
|
python ..\server.py
|
|
goto :EOF
|
|
|
|
:NOPYTHON3
|
|
echo
|
|
mshta javascript:alert^("Error\n======\n\nThis sample needs a Python installation.\nEither Python 2 or Python 3 needs to be installed\nand accessible (in the path)!"^);close^(^);
|