Im using raspberry pi and i want to control another windows machine by sending command using winexe. i can use the command directly from the terminal. However if i use python to send the command, the command seems invalid.
i can run this command at the terminal with no problem
winexe -U pc1%ppc1 //ipaddress 'netsh interface show interface'
i know its not practical to use os.system but the syntax works fine for me if use it with python
os.system('winexe -U pc1%ppc1 //ipaddress "netsh interface show interface"')
when i want to quote another syntax. with the terminal i run it and it works perfectly fine
winexe -U pc1%ppc1 //ipaddress 'netsh interface set interface "Local Area Connection admin=disable'
How can i use python to run the syntax for above line? i have already tried with
os.system('winexe -U pc1%ppc1 //ipaddress "netsh interface set interface "Local Area Connection" admin=disable"')
but the code cant run its just loading forever. its like i quote it wrongly. anyway to fix this?