I have a home project that I am working on that manipulates the network cards state ie on or off.

I have already completed this usinng WFA, it runs with batch scripts that takes the adapters name and sets its state. However doing it through batch scripts, If I wanted to use it on another computer I would have to go and change the adapter names inside the batch scripts to match the new cards.

How can I make it so that I can run the program on anycomputer and it will automatically detect the network adapter without supplying it its name?

This is a snippet of my code that enables the ethernet adapter:

 if (radioButtonEthernet.Checked)
            {
                try
                {
                    batch = @"C:\Users\Keil\Documents\Visual Studio 2013\Projects\Network Adapter\disable_Ethernet.bat";

                    app.Enable(batch);

                    labelStateList1.Text = ("Adapter: Ethernet is disabled");
                    label6.Text = ("");
                    dEthernet = true;
                }

                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
            }
helloWorld22 commented: good question +0
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.