Link to home
Start Free TrialLog in
Avatar of SaffronThePuppy
SaffronThePuppy

asked on

call ipconfig from Python, then return select results into list or dictionary

I want to all a cmd.exe function such as ipconfig from the REPL and return results into a list to do something else with. Any ideas how to do this?
 Thanks folks!!
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

ipconfig > file.txt

Works in cmd and powershell.

Or, if you want to append, use >>

In powershell, $i = ipconfig will store the result of the command in $i

HTH,
Dan
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SaffronThePuppy
SaffronThePuppy

ASKER

Thank you, this answers the question. The actual command is a symcli command with complex output. It was calling the subprocess that I needed. Appreciated!
Glad I could help. Thank you.