How can I control the "enable/disable" network connections from the control panel through visual basic? Or what params do I pass to svchosts.exe to control this, or what is the actual service name of "Network Connections" in services.msc so I can use "NET STOP {SERVICE} | NET START {SERVICE} ? Any ideas to how I can manipulate a program to the actual network connection would be great.

:D

Recommended Answers

All 2 Replies

Hi esdesign,

Have you tried using the "Shell" function in VB? Since you know how to use the NET command Shell might be what you need.

The call would look like

Shell ("NET START <Your parameters>", <WindowStyle>)

Hope this helps

Yomet

Hey, thanks for the reply. I actually figured out the service names for connecting to the internet or just the local network file sharing services.

NET STOP WORKSTATION /y <-- stops all local network services (file sharing, etc.. /y switch auto inserts y at prompts for each service being stopped)
NET START WORKSTATION

and

NET STOP DHCP
NET START DHCP

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.