Command Line Error

Post Reply
ezninnovation
Newbie
Posts: 15
Joined: Tue May 14, 2024 8:46 pm

Command Line Error

Post by ezninnovation »

I am trying to run a python script via the execute command element to unlock a pdf.

I set my command to location of my python.exe: C:/Users/switch/AppData/Local/Programs/Python/Python313/python.exe
I set my arguments to the directory where my program is "...UnsecurePDF.py" --input "%1" --output "%2"

The job fails with Job failed because outcode is nonzero, outcode = [1] and when I check the Log files the error is the following:

'/c' is not recognized as an internal or external command, operable program or batch file.

This runs correctly when I run it from the CMD prompt but I cannot get it to run within Switch.

Thanks in advance.
User avatar
tdeschampsBluewest
Member
Posts: 158
Joined: Tue Jun 01, 2021 11:57 am

Re: Command Line Error

Post by tdeschampsBluewest »

Hi,

For standard command execution, I would recommend trying the Run command app. It is generally much simpler and more robust than the default Execute Command element.

That said, the issue you are encountering is very likely related to a space in the path to your Python executable or script. In that case, enclosing the full path in quotes should resolve the problem.
However, based on the command you shared, this already appears to be correctly handled, which makes the behavior somewhat unexpected.
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Post Reply