none
Delete network adapters via dos command RRS feed

  • Question

  • I have about one to two hundred PC’s I need to delete 2 network adapters on.

    I can’t use PowerShell because some are XP and server 2003 that may not have PowerShell enabled.

    It is the Teredo Tunneling Adapter and the Microsoft ISATAP adapter. 

    I was sure I could do this in the command line so I could do a batch file to just run on each using netsh but if so I can’t get the syntax.

    Can anyone lend any advice on how I can accomplish this with batch?

    Thanks


    R White

    Thursday, October 16, 2014 11:13 PM

Answers

  • OK so if any one else is having my issue and you mistakenly came to this forum only to get belittled by a "Expert" like JRV here is a solution.

    First Power shell MAY NOT work on all XP 2003 machines and if so not all commands may work.  For this issue i am sure there are many ways to accomplish this task but here is a good CMD batch based solution that will work on all of these OS's.

    You will need a very small (under 1 meg) free NO INSTALL NEEDED exe called devcon.exe.

    No need to worry it is a MS program and odds are it is already on your servers. You can download it or get it off a server 2003 install disk.

    Put it in a folder that is shared and in the same folder put a little batch file with the below code.  It will do the job of removing adapters.  You will need to copy the folder to what ever server you are working on as it does not like running from a network share but it is very very small.  If i can attach a zip of it i will.  See code below.   Thanks!

    @echo off
    REM  The below section list any adapters with isatap or teredo in the name.
    REM  **********************************************************************
    REM  **********************************************************************
    devcon findall =net |findstr /I "isatap teredo"
    REM  **********************************************************************
    REM  **********************************************************************
    REM The below section removes any adapters with isatap or teredo in the name
    REM  **********************************************************************
    REM  **********************************************************************
    echo 
    echo 
    Echo Press Spacebar 3 times to remove the above listed adapters.
    pause
    pause
    pause
    devcon disable *teredo*
    devcon remove *teredo*
    devcon disable *ISATAP*
    devcon remove *ISATAP*
    devcon findall =net |findstr /I "isatap teredo"
    pause
    REM  **********************************************************************
    REM  **********************************************************************



    R White



    • Marked as answer by tnetplus Friday, October 17, 2014 3:32 PM
    • Edited by tnetplus Friday, October 17, 2014 3:33 PM
    Friday, October 17, 2014 3:31 PM

All replies

  • PowerShell is native to XP and Windows Server 2003.

    I think yu need to spend some time learning the basics.

    What you are asking is if there is a command line utility that can do what you ask.  There is but it is not a script.  Post in the platform forum for you system and they will help you with command utilities.


    ¯\_(ツ)_/¯


    • Edited by jrv Thursday, October 16, 2014 11:50 PM
    Thursday, October 16, 2014 11:46 PM
  • That is such a back handed answer.     "I think yu need to spend some time learning the basics".

    Does this make you feel better?

    It amazes me the just pitiful folks on here.  You might think that of the people seeking help but we are on a help forum but you are one of the "Experts"  


    R White

    Friday, October 17, 2014 12:43 AM
  • Unfortunately, as usual, you are asking the wrong question in the wrong forum.

    There is no DOS command to d what you ask.  It is not a scripting question. ANd you are being indignant because of lack of knowledge and experience.

    With a little basic training you would learn what the implications of your question are.

    Look at the network adapter.  Use PowerShell. "Get-WmiObject Win32-Network Adapter"

    Do you see and "delete" method?

    We have been throughthis before about learning the basics.  I am not picking on you.  YOu havenot done \your homework.  Whenany of us give you a negative answer you whine like a stuck pig.

    You really need to do your homework and stop complaining that others are treating you unfairly.  Evenyou can learnthis stuff.  It is not that difficult except if you are too lazy to put in the effort.

    You need to spend some time learning the basics. It is your choice.  Learn or burn.  I suspect you will choose to burn.


    ¯\_(ツ)_/¯

    Friday, October 17, 2014 1:07 AM
  • You are such a sad sad person.

    So if i go to run that Power-shell and the Execution Policy is not set then that is another step.   

    Perhaps you should learn to 

    A Spell (that's 101)

    B Spell

    C have worth 

    I am on a help form for help you are here to show how good and smart you must be.  

    LOOSER


    R White

    Friday, October 17, 2014 1:46 AM
  • Please ask a question.  You are just complaining.  What is it that we can do to help.  Again I repeat.  There is no command line to do what you ask and this is a scripting forum, it is not a help desk for command line issues.

    If you want help with commandline utilities thenn please post in the system forum for your OS version.

    I am sorry that we cannot be of help but, since you have been through this before,  I am sure you understand. \

    Post back with any new issues concerning your scripting efforts.  We will gladly help you.

    Have a nice weekend.


    ¯\_(ツ)_/¯

    Friday, October 17, 2014 2:14 AM
  • PowerShell is native to XP and Windows Server 2003.

    I think yu need to spend some time learning the basics.

    What you are asking is if there is a command line utility that can do what you ask.  There is but it is not a script.  Post in the platform forum for you system and they will help you with command utilities.


    ¯\_(ツ)_/¯


    I don't think that's right.

    It shipped with Vista and Server 2008. It was back-ported for installation onto XP  and Server 2003 with SP2, but it was not native to those versions.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Friday, October 17, 2014 3:07 AM
    Moderator
  • My use of "native" was to indicate "normal" or "usual and available" but not internal or part of the OS. .  I intended that it was truly available for those systems.

    Sorry if that was unclear.


    ¯\_(ツ)_/¯

    Friday, October 17, 2014 3:20 AM
  • OK so if any one else is having my issue and you mistakenly came to this forum only to get belittled by a "Expert" like JRV here is a solution.

    First Power shell MAY NOT work on all XP 2003 machines and if so not all commands may work.  For this issue i am sure there are many ways to accomplish this task but here is a good CMD batch based solution that will work on all of these OS's.

    You will need a very small (under 1 meg) free NO INSTALL NEEDED exe called devcon.exe.

    No need to worry it is a MS program and odds are it is already on your servers. You can download it or get it off a server 2003 install disk.

    Put it in a folder that is shared and in the same folder put a little batch file with the below code.  It will do the job of removing adapters.  You will need to copy the folder to what ever server you are working on as it does not like running from a network share but it is very very small.  If i can attach a zip of it i will.  See code below.   Thanks!

    @echo off
    REM  The below section list any adapters with isatap or teredo in the name.
    REM  **********************************************************************
    REM  **********************************************************************
    devcon findall =net |findstr /I "isatap teredo"
    REM  **********************************************************************
    REM  **********************************************************************
    REM The below section removes any adapters with isatap or teredo in the name
    REM  **********************************************************************
    REM  **********************************************************************
    echo 
    echo 
    Echo Press Spacebar 3 times to remove the above listed adapters.
    pause
    pause
    pause
    devcon disable *teredo*
    devcon remove *teredo*
    devcon disable *ISATAP*
    devcon remove *ISATAP*
    devcon findall =net |findstr /I "isatap teredo"
    pause
    REM  **********************************************************************
    REM  **********************************************************************



    R White



    • Marked as answer by tnetplus Friday, October 17, 2014 3:32 PM
    • Edited by tnetplus Friday, October 17, 2014 3:33 PM
    Friday, October 17, 2014 3:31 PM
  • PowerShell is native to XP and Windows Server 2003.

    I think yu need to spend some time learning the basics.

    What you are asking is if there is a command line utility that can do what you ask.  There is but it is not a script.  Post in the platform forum for you system and they will help you with command utilities.


    ¯\_(ツ)_/¯


    I said there was a command line utility.  You found it.  It is not a script. That is why I suggested posting in the platform forum.  It was you who decided throw a temper tantrum.  You would have found it much faster if you had just listen.

    This is also why I recommended that you learn the basics.  You have been going around in this same frustrated circle for as long as I can remember you being here. 

    You can dislike me all you want but that does not change the facts.   Ifyou don't like the truth then don't ask.


    ¯\_(ツ)_/¯


    • Edited by jrv Friday, October 17, 2014 3:48 PM
    Friday, October 17, 2014 3:48 PM
  • R White: I deleted your offensive post. Please refrain from such comments. A second violation will cause you to be banned from these forums.


    -- Bill Stewart [Bill_Stewart]

    Friday, October 17, 2014 3:57 PM
    Moderator
  • You can have all the knowledge in the world but if you can't provide a answer better then the one you did as back handed then you have little value.

    you simply said it could not be done. The only frustrations I have is attitude from someone who can't offer a answer with out insulting I

    I work with 100 rock solid wonderful knowledgeable folks and don't need a back handed attempt at a answer that is not even a answer. 


    Bill I do apologize it is overall a great community of folks and I should have acted better. 


    R White

    Friday, October 17, 2014 4:12 PM
  • Keep in mind that the help here is free and the participants are volunteers. I find that your comments were far more offensive than what jrv was trying to tell you. He was correct in pointing out that this is not a forum for help with command-line utilities. I would add the following:

    1. Your problem is solved by the devcon.exe program, which doesn't really have anything to do with scripting per se; it is a command-line tool. (Simply putting some batch scripting lines around a command line tool does not mean you have a scripting question.)

    2. It is considered bad form to ask off-topic questions.


    -- Bill Stewart [Bill_Stewart]

    Friday, October 17, 2014 4:20 PM
    Moderator
  • Free does not equal rude I

    I or any professional I have worked with could have answered that in a million better ways since we are using hindsite. a

    and yes it is scripting there are many scrips built off psexec and the executables placed in the operating system themselves. I

    I have used other forms and sometimes you have to deal with a sad individual who makes me wonder why you are a expert on a help form. 


    R White

    Friday, October 17, 2014 4:32 PM
  • A question about how to use a command-line tool is not a scripting question, even if you put such a command in a shell script (batch file).

    In any case, I am glad that you were able to answer your own question and post the solution.


    -- Bill Stewart [Bill_Stewart]

    Friday, October 17, 2014 4:39 PM
    Moderator
  • Oh i just saw your profile pic Bill and know you have helped be before so thank you.  

    If i may i had posed the same question on another form and this was the full 100% unedited response .

    "Maybe use devcon.exe"

    This was my full unedited reply.

    "You are a genius.  Worked GREAT!    Thank you!"

    Short thread.   Take care




    R White

    Friday, October 17, 2014 4:50 PM