Reputation:
Anyone can help me that how to pass two commands in Popen function
I have to pass following two command to be executed in cmd console
netsh wlan set hostednetwork mode=allow ssid=kumawat_infinity key=123456789a
NETSH WLAN start hostednetwork
These command will enable hotspot in window.
import os
os.popen('netsh wlan set hostednetwork mode=allow ssid=kumawat_infinity key=123456789a')
os.popen('NETSH WLAN start hostednetwork')
Upvotes: 0
Views: 80
Reputation: 24711
You can just put both your commands in the same string, separated by a semicolon. This is the function of the semicolon in the bash programming language.
Example:
os.popen(
'netsh wlan set hostednetwork mode=allow ssid=kumawat_infinity key=123456789a; netsh wlan start hostednetwork'
)
Upvotes: 1