B
B
Bugedig2021-08-04 14:49:55
System administration
Bugedig, 2021-08-04 14:49:55

How to make .bat from commands for windows command line?

Good afternoon. How to make .bat so that all commands are executed?
Commands:
netsh
advfirewall firewall
add rule name="Deny outgoing traffic on port 9786" dir=out localport=9786 protocol=TCP action=block

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lik173, 2021-08-04
@bugedig

netsh exec <script file>
See netsh /?
You can do this:
@echo off
echo advfirewall firewall> port9786.txt
echo add rule name="Deny outgoing traffic on port 9786" dir=out localport=9786 protocol=TCP action=block>> port9786.txt
netsh exec port9786.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question