我试试这批
start cmd.exe /k "C:\Program Files (x86)\QGIS 2.18\OSGeo4W.bat" ogr2ogr.exe -f "PostgreSQL" PG:"host=10.210.1.32 user=eric_plassot dbname=activite schemas=activite password=mdp" -t_srs EPSG:2154 -append -nlt PROMOTE_TO_MULTI "C:\Users\eplassot\toto.kml"
并收到此错误
C: \ Program' is not recognized...
我该怎么办?
答案 0 :(得分:1)
因为您使用多个引号,所以在语法上不清楚嵌套引号的开始位置。试试这个:
start cmd.exe /k ""C:\Program Files (x86)\QGIS 2.18\OSGeo4W.bat" ogr2ogr.exe -f "PostgreSQL" PG:"host=10.210.1.32 user=eric_plassot dbname=activite schemas=activite password=mdp" -t_srs EPSG:2154 -append -nlt PROMOTE_TO_MULTI "C:\Users\eplassot\toto.kml""
答案 1 :(得分:1)
start
可能会将第一个引用的参数解释为窗口标题,因此请明确提供一个(甚至可能是空的,如""
)以避免麻烦。 cmd /K
使用前导和尾随引号,因此其余命令行显示为无效。为避免这种情况,请将整个命令行括起来调用""
。为了避免需要转义命令行,请转义最外面的引号:
start "" cmd.exe /K ^""C:\Program Files (x86)\QGIS 2.18\OSGeo4W.bat" ogr2ogr.exe -f "PostgreSQL" PG:"host=10.210.1.32 user=eric_plassot dbname=activite schemas=activite password=mdp" -t_srs EPSG:2154 -append -nlt PROMOTE_TO_MULTI "C:\Users\eplassot\toto.kml"^"
答案 2 :(得分:0)
第一批调用的是
SELECT log1.`deviceID`, log1.`timestamp` AS `on`, log2.`timestamp` as `off`
FROM `HC2_log_raw` log1, `HC2_log_raw` log2
WHERE log1.`newValue` > 0 AND log1.`oldValue` = 0 AND log2.`newValue` = 0 AND log1.`deviceID` = log2.`deviceID` AND
log2.`timestamp` =
(SELECT MIN(log3.`timestamp`)
FROM `HC2_log_raw` log3
WHERE log3.`timestamp` > log1.`timestamp` AND log3.`deviceID` = log1.`deviceID` AND log3.`newValue`=0)
rem根OSGEO4W主目录到此脚本所在的同一目录 设置OSGEO4W_ROOT =%~dp0 rem将双反斜杠转换为单反 设置OSGEO4W_ROOT =%OSGEO4W_ROOT:\ = \% 回声。 &安培; echo OSGEO4W主页是%OSGEO4W_ROOT%&回声。
设置PATH =%OSGEO4W_ROOT%\ bin;%PATH%
rem添加特定于应用程序的环境设置 对于%% f in(“%OSGEO4W_ROOT%\ etc \ ini * .bat”),请调用“%% f”
rem列出可用的o4w程序 rem但是只有在没有参数的情况下调用osgeo4w @echo on @if [%1] == [](echo run o-help获取可用命令列表& cmd.exe / k)else(cmd / c“%*”)