a VB snippet to change DNS back to obtain automatically

Discussion in 'Scripting' started by Terry, Apr 8, 2005.

  1. Terry

    Terry Guest

    Hello everyone, does someone have a snippet to change/remove static DNS
    entries on a XP box back to, Obtain DNS server address automatically.





    Thanks Terry.
     
    Terry, Apr 8, 2005
    #1
    1. Advertisements

  2. Terry

    James Guest

    cmd prompt :

    Netsh inter ip set dns name="Local Area Connection" source=dhcp
     
    James, Apr 8, 2005
    #2
    1. Advertisements

  3. Terry

    Terry Guest

    Thanks, but I need the the VB code for doing this as it is imbedded in a
    script.
     
    Terry, Apr 8, 2005
    #3
  4. Terry

    James Guest

    set objshell = wscript.createobject("wscript.shell")
    filenamex="Netsh inter ip set dns name="Local Area Connection" source=dhcp
    "
    objshell.run ("%comspec% /c " & filenamex) ,0,true
     
    James, Apr 8, 2005
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.