1

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 by iConqueror: added code

Votes + Comments
good question
2
Contributors
1
Reply
14
Views
2 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.