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());
                }
            }

Edited 2 Years Ago by iConqueror: added code

Comments
good question
This article has been dead for over six months. Start a new discussion instead.