Question

netsh script works fine in Command Prompt but the batch file

Hate to make another one of these threads as I see them all the time, but frankly nothing has helped.
I'm trying to create two batch files, one to enable my network adapter and the other to disable it. I plan on using them with Task Scheduler as a security measure (had a recent ransomware crisis).
This is what I have:
netsh interface set interface Ethernet DISABLE
and
netsh interface set interface Ethernet ENABLE
Ethernet is of course my interface's name. They both work as intended in command prompt, but the batch files don't accomplish anything (even when I run as admin) other than a flashing cmd window.
Thanks!

Discussion is locked

Follow
Reply to: netsh script works fine in Command Prompt but the batch file
PLEASE NOTE: Do not post advertisements, offensive materials, profanity, or personal attacks. Please remember to be considerate of other members. If you are new to the CNET Forums, please read our CNET Forums FAQ. All submitted content is subject to our Terms of Use.
Reporting: netsh script works fine in Command Prompt but the batch file
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Comments
- Collapse -
Clarification Request
So as a test.

Open the cmd window and type in the batch filename. What happens?

- Collapse -
RE: So as a test.

Hey thanks for point that out. I get the following:

The following command was not found: netsh interfaceàset interface Ethernet DISABLE

No that's not a typo, it's throwing in an accented 'a' over a space. Is this for a particular reason? I've tried rewriting the script and deleting and remaking the entire file, still get the same result.

- Collapse -
I'm missing which OS.

CNET Forums

Forum Info