r1374065
2018-07-05 01:28
采纳率: 75%
浏览 2.8k
已采纳

.bat需要重复调用另一个.bat,但执行一条语句就退出

aa.bat


L2A_Process --resolution 10 G:\shaoyi\S2A_MSIL1C_20180617T021601_N0206_R003_T52TDR_20180617T055201.SAFE
L2A_Process --resolution 10 G:\shaoyi\S2B_MSIL1C_20180509T023549_N0206_R089_T51TXN_20180509T053626.SAFE
L2A_Process --resolution 10 G:\shaoyi\S2A_MSIL1C_20180617T021601_N0206_R003_T52TDR_20180617T055216.SAFE
L2A_Process --resolution 10 G:\shaoyi\S2B_MSIL1C_20180509T023549_N0206_R089_T51TXN_20180509T053629.SAFE
L2A_Process --resolution 10 G:\shaoyi\S2A_MSIL1C_20180617T021601_N0206_R003_T52TDR_20180617T055216.SAFE
L2A_Process --resolution 10 G:\shaoyi\S2B_MSIL1C_20180509T023549_N0206_R089_T51TXN_20180509T053602.SAFE
L2A_Process --resolution 10 G:\shaoyi\S2A_MSIL1C_20180617T021601_N0206_R003_T52TDR_20180617T055206.SAFE
L2A_Process --resolution 10 G:\shaoyi\S2B_MSIL1C_20180509T023549_N0206_R089_T51TXN_20180509T053603.SAFE

被调用的L2A_Process.bat

 @echo off

setlocal

set CURRENT_SCRIPT_DIR=%~dp0

set SYSPATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
set PATH=%CURRENT_SCRIPT_DIR%\bin;%SYSPATH%

set GDAL_DATA=%CURRENT_SCRIPT_DIR%\share\data
set GEOTIFF_CSV=%CURRENT_SCRIPT_DIR%\share\epsg_csv
:: unset some variables that allows to have an isolate python environment

set PYTHONPATH=
set PYTHONHOME=
set PYTHONEXECUTABLE=
set PYTHONUSERBASE=

set GDAL_DRIVER_PATH=disable

set SEN2COR_HOME=%USERPROFILE%\Documents\sen2cor\2.5
set SEN2COR_BIN=%CURRENT_SCRIPT_DIR%\Lib\site-packages\sen2cor

::echo "setting SEN2COR_HOME is %SEN2COR_HOME%"

if not exist "%SEN2COR_HOME%" ( 
mkdir "%SEN2COR_HOME%"
)
if not exist "%SEN2COR_HOME%\cfg" mkdir "%SEN2COR_HOME%\cfg"

if not exist "%SEN2COR_HOME%\cfg\L2A_GIPP.xml" (
 xcopy /F "%SEN2COR_BIN%\cfg\L2A_GIPP.xml" "%SEN2COR_HOME%\cfg\"
)

"%CURRENT_SCRIPT_DIR%\bin\python.exe" -s "%SEN2COR_BIN%\L2A_Process.py" %*


endlocal

3条回答 默认 最新

相关推荐 更多相似问题