help for creating batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
saeid_1987
Posts: 1
Joined: 12 Mar 2019 23:47

help for creating batch file

#1 Post by saeid_1987 » 12 Mar 2019 23:59

Hello everyone
what I need to do is switching my network adaptors on/off with a batch file.
Right now, I have two batch files, one of them to disable adaptor 1 and enable adaptor 2.
the second batch file is to disable adaptor 2 and enable adaptor 1.
is there any way I can merge them into a smarter file, maybe with an "IF" command or anything like that, so that it checks to see which adaptor is enabled and disable it, and vice-versa?
Thanks in advance

penpen
Expert
Posts: 1669
Joined: 23 Jun 2013 06:15
Location: Germany

Re: help for creating batch file

#2 Post by penpen » 13 Mar 2019 06:41

saeid_1987 wrote:
12 Mar 2019 23:59
is there any way I can merge them into a smarter file, maybe with an "IF" command or anything like that, so that it checks to see which adaptor is enabled and disable it, and vice-versa?
It could be a yes;
it depends on the source code you have.
Maybe you should consider also positing that sources.

penpen

Post Reply