[FWTools] Schedule ogr2ogr within batch file

Richard Greenwood richard.greenwood at gmail.com
Fri Sep 12 09:21:14 EDT 2008


Remove the "@echo off" so that you can see the error message.

Rich


On Thu, Sep 11, 2008 at 1:27 AM, Steve White <archmapper at googlemail.com> wrote:
> I have a VRT file that I use to dump all data from a SQL Server DB to SHP.
> This works perfectly.
>
>
>
> Now I want to run this process in a batch file on a schedule using Task
> Scheduler in Windows 2003 Server.
>
>
>
> I'm no batch expert and have done a bit of reading but can't get it to work.
>
>
>
> Here's what I have so far:
>
>
>
> @echo off
>
> cd "C:\Program Files\FWTools2.2.3\bin"
>
> ogr2ogr -f "ESRI Shapefile" -sql "select ItemID, ItemName, Latitude,
> Longitude, CategoryName, CAST(IDesc AS character(255)) AS 'IDesc', CatId
> from OA" "C:\Output - SHP files\OA.shp" "C:\VRT files\OAData.vrt" -a_srs
> epsg:4326
>
>
>
> When I run it nothing happens, but if I open a CMD prompt go directly to
> "C:\Program Files\FWTools2.2.3\bin" and run the following it works:
>
> ogr2ogr -f "ESRI Shapefile" -sql "select ItemID, ItemName, Latitude,
> Longitude, CategoryName, CAST(IDesc AS character(255)) AS 'IDesc', CatId
> from OA" "C:\Output - SHP files\OA.shp" "C:\VRT files\OAData.vrt" -a_srs
> epsg:4326
>
>
>
> Anyone help me out with this?
>
>
>
> Cheers,
>
>
>
> Steve
>
> _______________________________________________
> FWTools mailing list
> FWTools at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/fwtools
> http://fwtools.maptools.org/
>
>



-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the FWTools mailing list