Thread: Help disabling network interface from code

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    2

    Help disabling network interface from code

    Hello,

    I've been trying to disable the network interface card from within the code in C using Windows. Something like: ifconfig eth0 down, in linux. Is there a way to do this from code in Windows?

    Thanks a lot.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Why do you want to do that?

    gg

  3. #3
    Registered User
    Join Date
    Mar 2005
    Posts
    2
    Hi,

    I want to do that because I'm writing a SNMP agent and I would like to disable the network interface when certain object gets certain value. Something I would like that the agent does. I'm looking for either code or a program that comes with the windows installation.

    Thanks

  4. #4
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    have a look at the parameters available to rundll, you can pass things such as exitWindows, and ExitWindowsExec, for shutdowns and restarts, it may have something to handle the network interface.
    Monday - what a way to spend a seventh of your life

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with network animator code
    By fastshadow in forum C Programming
    Replies: 1
    Last Post: 03-17-2006, 10:37 AM
  2. Problem with network code
    By cornholio in forum Linux Programming
    Replies: 1
    Last Post: 12-20-2005, 01:21 AM
  3. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 01:33 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Network Code!
    By SlimDady in forum C++ Programming
    Replies: 4
    Last Post: 04-05-2002, 07:16 PM