Skip to content

Instantly share code, notes, and snippets.

@jef-n
Last active February 22, 2018 11:16
Show Gist options
  • Save jef-n/a4c658f0287f8cedd4e9ab7064b8d956 to your computer and use it in GitHub Desktop.
Save jef-n/a4c658f0287f8cedd4e9ab7064b8d956 to your computer and use it in GitHub Desktop.
make-bat-for-py.bat
@echo off
echo.
echo. Generating .bat files for all .py files in %OSGEO4W_ROOT%\bin
echo.
pushd "%OSGEO4W_ROOT%\bin"
for %%g in (*.py) do (
if not exist %%~ng.bat (
echo @echo off >%%~ng.bat
echo call "%%OSGEO4W_ROOT%%\bin\o4w_env.bat" >>%%~ng.bat
echo python "%%OSGEO4W_ROOT%%\bin\%%g" %%* >>%%~ng.bat
)
)
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment