How do I log on (n/w connection) via a script?
-
I've created a dial-up network connection and I am able to click on the icon, then click Dial, and successfully make a new internet connection. When I am done, I can right-click on the network icon and disconnect it. However, I need to do this from an application without human interaction. I don't know how to start this dialog (minimized) and tell it to dial. Furthermore, I don't know how to disconnect the link when I am finished. The connection is a GPRS modem connection where time/data can be costly. The application (on the laptop) needs to get online, transfer some data, and then hang up, all without user intervention. What is the proper way to do this? As an alternative, I can successfully write to the COM port, (AT+CGDCONT=1,"IP","internet2.voicestream.com" and then AT*99***1#") but then the ISP connection starts spewing PPP data. I don't know what the equivalent to PPPD is on Windows XP or how to transfer the COM port handle to the daemon. Any help or links on the matter would be greatly appreciated. All the searches I've investigated show how to do this with mouse clicks and nothing automated. Thanks, Paul PS: The script can be .BAT or C++/MFC classes (6.0)
-
I've created a dial-up network connection and I am able to click on the icon, then click Dial, and successfully make a new internet connection. When I am done, I can right-click on the network icon and disconnect it. However, I need to do this from an application without human interaction. I don't know how to start this dialog (minimized) and tell it to dial. Furthermore, I don't know how to disconnect the link when I am finished. The connection is a GPRS modem connection where time/data can be costly. The application (on the laptop) needs to get online, transfer some data, and then hang up, all without user intervention. What is the proper way to do this? As an alternative, I can successfully write to the COM port, (AT+CGDCONT=1,"IP","internet2.voicestream.com" and then AT*99***1#") but then the ISP connection starts spewing PPP data. I don't know what the equivalent to PPPD is on Windows XP or how to transfer the COM port handle to the daemon. Any help or links on the matter would be greatly appreciated. All the searches I've investigated show how to do this with mouse clicks and nothing automated. Thanks, Paul PS: The script can be .BAT or C++/MFC classes (6.0)
Take a look at the netsh command this[^] article may help, although I couldn't get it to work in the brief time I tried it.
If you're stuck in a rut: 1) Consult the documentation* 2) Google it 3) Ask a sensible question 4) Try an ancient ritualistic knowledge summoning (:badger::badger::badger:) dance :jig: 5) Phone :bob: * - If the documentation is MSDN > 6.0 then forget it!
-
Take a look at the netsh command this[^] article may help, although I couldn't get it to work in the brief time I tried it.
If you're stuck in a rut: 1) Consult the documentation* 2) Google it 3) Ask a sensible question 4) Try an ancient ritualistic knowledge summoning (:badger::badger::badger:) dance :jig: 5) Phone :bob: * - If the documentation is MSDN > 6.0 then forget it!
-
I've created a dial-up network connection and I am able to click on the icon, then click Dial, and successfully make a new internet connection. When I am done, I can right-click on the network icon and disconnect it. However, I need to do this from an application without human interaction. I don't know how to start this dialog (minimized) and tell it to dial. Furthermore, I don't know how to disconnect the link when I am finished. The connection is a GPRS modem connection where time/data can be costly. The application (on the laptop) needs to get online, transfer some data, and then hang up, all without user intervention. What is the proper way to do this? As an alternative, I can successfully write to the COM port, (AT+CGDCONT=1,"IP","internet2.voicestream.com" and then AT*99***1#") but then the ISP connection starts spewing PPP data. I don't know what the equivalent to PPPD is on Windows XP or how to transfer the COM port handle to the daemon. Any help or links on the matter would be greatly appreciated. All the searches I've investigated show how to do this with mouse clicks and nothing automated. Thanks, Paul PS: The script can be .BAT or C++/MFC classes (6.0)