Jeremy:Here is a bat file example that calls a python script:@echo off
set pyexePath="C:\Python26\ArcGIS10.0\python.exe"
set pylogPath="C:\GIS\ServerProcesses\Bezier_Removal\Bezier_Remover_Simplify.log"
set BezRemove_pyPath="C:\GIS\ServerProcesses\Bezier_Removal\01_Bezier_Remover.py"
echo Start time: %time% > %pylogPath%
REM Run the python script
echo ------ Update time: %time%
echo ------ Removing Bezier curves from RDCL in Transportation GDB --------
echo ------ Removing Bezier curves from RDCL in Transportation GDB -------- >> %pylogPath%
%pyexePath% %BezRemove_pyPath% >> %pylogPath%
echo End time: %time% >> %pylogPath%
Here is the python script that this bat file is calling:# ---------------------------------------------------------------------------
# Bezier_Remover.py
# Created on: 2011-11-15 15:27:13.00000
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import sys, string, os
import arcpy
import arcpy.mapping
from arcpy import env
import smtplib #E-mail library
# Set environment
arcpy.env.overwriteOutput = True
# Local variables:
RDCL_SRCH__2_ = "RDCL_SRCH"
TRANS_RDCL_SRCH = r"\\Server\GIS\Enterprise\Data\transportation\Transportation.gdb\TRANSPORTATION_RDCL_SRCH"
try:
print("Densifying TRANSPORTATION_RDCL to remove Bezier Curves")
# Process: Densify
arcpy.Densify_edit(TRANS_RDCL_SRCH, "DISTANCE", "25 Feet")
except:
print arcpy.GetMessages(2)
SUBJECT = "Road Densify Script Failed"
TO = "person@mail.org"
FROM = "Process_Server"
text = "Removal of Bezier Curves in Roads failed"
BODY = string.join((
"From: %s" % FROM,
"To: %s" % TO,
"Subject: %s" % SUBJECT ,
"",
text
), "\r\n")
server = smtplib.SMTP('mail server address',mail server port #) #server = smtplib.SMTP(HOST)
server.sendmail(FROM, [TO], BODY)
server.quit()
This is a very simple script that I have had running successfully on my Windows Server 2008 server for about 2 months now. The script simply removes Bezier curves from a polyline feature class as the web application that uses this data, fails when working with Bezier curves. I hope this helps you to solve your problem