I am trying to run a simple Python script which runs the ipconfig /all command as a proof of concept.
You can find it below:
from subprocess import PIPE, run my_command = "ipconfig /all" result = run(my_command, stdout=PIPE, stderr=PIPE, universal_newlines=True) print(result.stdout, result.stderr) But I didn't suceed to run it, I tryed both with the command line and by clicking on it but it open a cmd window for 1 second, and then close it so I cannot even read it.
Edit: I am using Python 3.7 and my script is called ipconfig.py
python ipconfig.pyshell=True(though a better approach is to proceed withshell=Falseand instead usemy_command=['ipconfig', '/all'])