-1

Currently, I am running an exe file (test.exe) by Powershell. It requires an input file's name as an argument. It means, I have to type ./test.exe input.txt in Powershell command in order to run the file in powershell.

And now I want to automate this stuff by Python, but I couldn't found a clear way to do this. As far as I figured out is that import subprocess and blah-blah is necessary but I am not that good into coding so can anybody tell me to make it?

'test.exe' file is located in C:\Users\KIM\Desktop\TEST and Powershell is located in C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

0

1 Answer 1

0

You can use this:

import subprocess
subprocess.call(['C:\Windows\System32\WindowsPowershell\v1.0\Powershell.exe', 'C:\Users\KIM\Desktop\Test\Test.exe', 'input.txt']) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.