Skip to content

Instantly share code, notes, and snippets.

@acgeospatial
Created February 22, 2024 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acgeospatial/e7195ddb67946f73d8a19f1cd2963a88 to your computer and use it in GitHub Desktop.
Save acgeospatial/e7195ddb67946f73d8a19f1cd2963a88 to your computer and use it in GitHub Desktop.
bat file to copy a master QGIS project to desktop and then open it
@echo off
set "sourcePath=D:\test.qgs"
set "destinationPath=%HOMEDRIVE%%HOMEPATH%\Desktop\test.qgs"
set "openCommand=C:\OSGeo4W\bin\qgis-ltr-bin.exe"
if not exist "%sourcePath%" (
echo Source file does not exist.
goto :eof
)
if exist "%destinationPath%" (
echo Destination file already exists. Replacing...
copy /y "%sourcePath%" "%destinationPath%"
) else (
echo Copying file to destination...
copy "%sourcePath%" "%destinationPath%"
)
echo Opening the file...
start "QGIS" /B "%openCommand%" "%destinationPath%"
timeout /t 5 >nul
:eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment