Fixlet that runs a python script isn't creating the zip file on windows like it does for linux

So I have a fixlet that is running a python script in both Linux and Windows and the linux piece of the fixlet runs like a dream but the Windows side while it shows Completed doesn’t produce the zip file at the end. I’m not sure what I am doing wrong as there isn’t any erroring or issues that I can easily find. I left out the Linux pieces as that appears to be working correctly and only left the Windows bits below. If anything looks off on the Fixlet side I would appreciate the assistance.

elseif {windows of operating system}
// Disable wow64 redirection on x64 OSes
action uses wow64 redirection {not x64 of operating system}

//
//Moving to the Monitoring_Tool table, removing any remnants of Monitor.py, json, and zip and then running the jar file
//
delete RemoveOldFiles.bat
appendfile cd C:\beanstore-client\dg\util\Monitoring_Tool
appendfile rm Monitor.py
appendfile rm *.json
appendfile rm *.zip

delete RemoveOldFiles.bat
copy __appendfile RemoveOldFiles.bat
runhidden RemoveOldFiles.bat

delete __createfile

// Running jar file through powershell
createfile until END_OF_FILE

Start-Process -FilePath java -WorkingDirectory C:\beanstore-client\dg\util\Monitoring_Tool -ArgumentList '-cp .;mariadb-java-client-1.7.3.jar ProductSkuTest'

END_OF_FILE

delete powershell.ps1
move __createfile powershell.ps1

waithidden { pathname of file ((it as string) of value "Path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" of native registry) } -ExecutionPolicy Bypass -File powershell.ps1

//
// Python program starts after the following line
//
createfile until _EOF

//Python program ends before the previous line


//Create a file with the Python program on the local filesystem
//
copy __createfile C:\beanstore-client\dg\util\Monitoring_Tool\Monitor.py

//Shell to Action Script Conversion Utility
delete __appendfile
delete RunMonitor.bat

appendfile cd C:\beanstore-client\dg\util\Monitoring_Tool
appendfile Monitor.py

copy __appendfile RunMonitor.bat
waithidden RunMonitor.bat


delete RunMonitor.bat


delete __appendfile
delete RemoveOldFiles.bat

appendfile cd C:\beanstore-client\dg\util\Monitoring_Tool
appendfile rm Monitor.py
appendfile rm items.txt
appendfile rm *.json

copy __appendfile RemoveOldFiles.bat
waithidden RemoveOldFiles.bat

delete RemoveOldFiles.bat
delete __appendfile
delete __createfile

Seems a lot of your action script has been trimmed out (including the Python content itself). That’s fine that you need to obscure it…I’ve generally tried to avoid running python from ActionScript because of the complications, but at least I can tell you what those complications are …

Windows doesn’t ship with a Python interpreter, it has to be installed separately.

By default the Python interpreter install is ‘per-user’, it’s not added to the system PATH and not associated to .py files. Which means your command line should be something like

Wait "c:\path\to\python.exe" "C:\path\to\script.py"

Hi Jason,

Yeah I initially had the entire script but thought that may be hazardous so trimmed down to just the action script pieces that surround the python script. Would you recommend trying to use that wait line in place of attempting to fold it all into a batch file and run that?

Ah, ok, I think I follow what you’re doing now.
‘RunMonitor.bat’ is a batch file that should switch into that working directory and then execute the Python script?

Again, it still could be that Python doesn’t have a file association for .py files, or Python.exe is not in the system PATH.
Leaving everything else the same, try changing the ‘waithidden’ line to

waithidden RunMonitor.bat > c:\windows\temp\output.log 2>&1

That should send the batch file output, including error messages, to a log file at c:\windows\temp\output.log. So you can see what will probably be a message that ‘There is no program associated with Monitor.py’, and you’ll need to change that line of the batch file to call out the full path to python.exe

Yep that exactly what i’m trying to do. I do know Python is installed on the machines i’m connecting to but I can’t verify if it’s in the system path or not so Ill try your recommendation and go from there.

Ill note that I can manually put the python script on the machine and run it and it works just fine so this is an issue with getting the fixlet setup correctly.