TACTIC Open Source
Execute cmd on windows server from Tactic - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: Execute cmd on windows server from Tactic (/showthread.php?tid=172)



Execute cmd on windows server from Tactic - Bassment - 09-24-2020

Hey all, I'm trying execute a .bat on a windows machine on the network from within Tactic.
The script works on the machine when run locally but is there a way to run this .bat from a Tactic trigger?
Basically, I want Tactic to tell the machine to run the cmd.


RE: Execute cmd on windows server from Tactic - listy - 09-24-2020

You mean something like? :

import subprocess
subprocess.call([r'your_bat.bat'])

Just create a Python trigger and run whatever .bat you want.


RE: Execute cmd on windows server from Tactic - Bassment - 09-30-2020

(09-24-2020, 10:05 PM)listy Wrote: You mean something like? :

import subprocess
subprocess.call([r'your_bat.bat'])

Just create a Python trigger and run whatever .bat you want.
Thanks listy, we were able to get something to work using a python script on the windows machine that listened for a change in the publish directory.
When a file is published to the directory on the server, the python code runs and excecutes the .cmd on that file.