I am running a batch file from an ignition vision button using the scripting functionality of the button. The code of the button is very simple.
a = "C:\U\h2ot\Desktop\batch.bat"
system.util.execute([a])
The batch file itself runs a python 3 script also located on my desktop. The batch file code is also very simple.
echo off
title Execute Python Script
echo Script executed
python C:/U/h2ot/Desktop/XMLRPC_04112024.py %*
start "iexplore.exe" http://www.google.com
pause
The python 3 file sends xmlrpc commands to another device. When I run the python 3 file from my command prompt, it works. The other device receives the command and does some verifiable action. However, from the ignition button the batch file runs (i can confirm because I put a simple validation in the batch file which opens a browser and redirects to google.com) however, the xmlrpc commands are not being successfully sent to the device. So, the python 3 script isn't actually being executed within the batch file when triggered from ignition. How do I get the python 3 script inside the batch file to actually run from an ignition button?
Two questions:
1.) Have you added any logging to the python3 script to see if there are any errors?
2.) When you are running the script from your command prompt are you running it as an elevated user?
1.No
2.Sorry, let me clarify.. When I run the batch file from the command prompt, the python3 file gets executed... but when the batch file is run from ignition, the python3 file doesnt run, only the command to open the browser and go to google.com