3 Replies Latest reply on Feb 16, 2018 1:46 PM by jrouviere

    Windows Python Script Monitor - Can't find script engine "Python"


      Hi everyone,


      I am attempting to create a Windows script monitor component using Python. I have installed ActivePython2.7 along with corresponding version of Pywin32 onto my Orion server. But when I perform the suggested test, I get the above error.


      C:\Users\myuser>python C:\Users\myuser\Desktop\TestScript.py



      C:\Users\myuser>cscript //E:Python C:\Users\myuser\Desktop\TestScript.py

      Microsoft (R) Windows Script Host Version 5.8

      Copyright (C) Microsoft Corporation. All rights reserved.


      CScript Error: Can't find script engine "Python" for script "C:\Users\myuser\Desktop\TestScript.py".


      We are running Windows Server 2012 R2 64bit. I have installed the 32bit versions of the two above files as suggested on another similar dicussion on Thwack, actually neither 32 or 64bit worked.


      Has anybody got this working? Any suggestions would be greatly appreciated



        • Re: Windows Python Script Monitor - Can't find script engine "Python"

          I have been playing around with this a bit for the last two days and it looks like there are two versions of cscript.  If I run cscript from path or from system32 I was having your issue, even though I'm using 32 bit Python as well.


          Finally found that there's a 64 bit version in .\syswow64 so when using that it started working.


          Additionally, I was getting a traceback error using exit(0); or any combination, but when switching to SystemExit(0) it worked with cscript with no issue.


          That's not the end of my rabbit hole, but hopefully it helps you resolve this issue.


          My test -

          C:\Windows\system32>c:\Windows\SysWOW64\cscript.exe /e:python c:\python34\Scripts\test.py