Created
February 22, 2024 08:33
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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