piccol.cmd 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @echo off
  2. setlocal ENABLEDELAYEDEXPANSION
  3. set PYPROG=piccol
  4. set PATH=%PATH%;C:\WINDOWS;C:\WINDOWS\SYSTEM32
  5. for /D %%f in ( "C:\PYTHON*" ) do set PATH=!PATH!;%%f
  6. for /D %%f in ( "%USERPROFILE%\AppData\Local\Programs\Python\Python*" ) do set PATH=!PATH!;%%f;%%f\Scripts
  7. for /D %%f in ( "%PROGRAMFILES%\Anaconda3" ) do set PATH=!PATH!;%%f
  8. for /D %%f in ( "%PROGRAMFILES(X86)%\Anaconda3" ) do set PATH=!PATH!;%%f
  9. for /D %%f in ( "%PROGRAMFILES%\Anaconda" ) do set PATH=!PATH!;%%f
  10. for /D %%f in ( "%PROGRAMFILES(X86)%\Anaconda" ) do set PATH=!PATH!;%%f
  11. set PYTHON=pyw
  12. %PYTHON% -h >NUL 2>&1
  13. if %ERRORLEVEL% EQU 0 goto exec_py
  14. set PYTHON=python3
  15. %PYTHON% -h >NUL 2>&1
  16. if %ERRORLEVEL% EQU 0 goto exec_python
  17. set PYTHON=pythonw
  18. %PYTHON% -h >NUL 2>&1
  19. if %ERRORLEVEL% EQU 0 goto exec_python
  20. set PYTHON=py
  21. %PYTHON% -h >NUL 2>&1
  22. if %ERRORLEVEL% EQU 0 goto exec_py
  23. set PYTHON=python
  24. %PYTHON% -h >NUL 2>&1
  25. if %ERRORLEVEL% EQU 0 goto exec_python
  26. echo Did not find Python 3.x in the PATH.
  27. echo Please make sure Python 3.x is installed correctly.
  28. pause
  29. goto end
  30. :exec_py
  31. @echo on
  32. start %PYTHON% -3 -B %PYPROG% %1 %2 %3 %4 %5 %6 %7 %8 %9
  33. @goto end
  34. :exec_python
  35. @echo on
  36. start %PYTHON% -B %PYPROG% %1 %2 %3 %4 %5 %6 %7 %8 %9
  37. @goto end
  38. :end