You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
567 B

  1. @echo off
  2. for %%d in (%~dp0.) do set Directory=%%~fd
  3. for %%d in (%~dp0..) do set ParentDirectory=%%~fd
  4. for /f "usebackq tokens=*" %%a in (`dir /A:D /B ^| findstr /r /i w.*py.*`) do (
  5. set _winpython=%%a
  6. goto skipB
  7. )
  8. :skipB
  9. set winpython="%Directory%\%_winpython%"
  10. for /f "usebackq tokens=*" %%a in (`dir /A:D /B %winpython% ^| findstr /r /i python.*`) do (
  11. set exe=%%a
  12. goto skipC
  13. )
  14. :skipC
  15. set exe="%winpython%\%exe%\python.exe"
  16. "%winpython%\t\7z.exe" a -t7z "%ParentDirectory%\python.7z" -p123456789 -mhe=on -mx "%Directory%" -xr!%_winpython% -xr!__pycache__