Select to view content in your preferred language

Batch File run from Python Script or Translate to python

6864
1
02-01-2011 04:27 PM
JoshMoloney
Emerging Contributor
Greetings,

I need to run a batchfile that kills 1 of our SDE servers from a python script (or even better translated into python and run as part of the script).

I have tried this in my script to run the batchfile:
import os
os.system("S:\1GIS\Batchfiles\Kill_Engineers.bat")


This doesn't appear to do anything. The batchfile requires a password to be entered. The batchfile has the followingh line of code:
sdemon -o kill -t all -s roc-a-a07 -i 5151


If I could do this from inside the python script it would be awesome. Any tips?

Thanks,
Geezer
Tags (2)
0 Kudos
1 Reply
RDHarles
Regular Contributor
That should work, I run a script similar to that, just switch your slashes around:

os.system("S:/1GIS/Batchfiles/Kill_Engineers.bat")
0 Kudos