Question Locked

How to disable the Windows firewall using the command shell...

0 helpful
14 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

(1) netsh -r commander

(2) it now shows this line,

[commander] netsh>

but before to that, their is a line that says, " ... WARNING: Could not obtain host i
s may not be available.
The RPC server is unavailable ... ".

what's this statement suppose to mean then ... any significant or effect perhaps to the commands i'm going to issue?

(3) i now tried to issue the command, netsh firewall set opmode mode = disable

but here what the result says, " ... The following command was not found: netsh firewall set opmode mode = disable ... ".

(4) what was wrong with the command i issue?

hoping to be enlighten.

thanks

14 replies

by dlandmesser

Hey man. If you can't get it using NET commands, try to do it using PSTOOLS. It's a set of command-line commands that can do awesome network stuff. Google and download it. It's free and easy. Hope this helps. You can kill processes using it, just like linux. I'm sure you can find and kill the firewall process using this.

by gergerdotcom

hello:)

i will definitely try to to search your suggestions.

and thanks really for the idea.

by the way, does the command "netstat -a -n", also help ... what is the effect of using the said command?

thanks:)

by rob miners

To disable the firewall, enter the following command in the Run dialog, or from a Command Line:

netsh firewall set opmode disable

To enable the firewall, enter the following command in the Run dialog, or from a Command Line:

netsh firewall set opmode enable

by gergerdotcom

hello true blue:)

thanks really for the info ... it also helps and adds an idea.

but what if i'm trying to disable a ANOTHER PC or remote pc, what will be the synthax then?

cheers!

by rob miners

an appropriate answer to your question. The answer to your second question.

The netsh firewall set opmode disable can only run locally.

You can't set firewall rules remotely for security reasons. One option is to use Group Policy.

If you could manage the Windows Firewall remotely then that would make it at least theoretically possible for a hacker to remotely disable/reconfigure the Windows Firewall on a given computer.

by rob miners

Click on Start, Run and type in cmd and press Enter.

Then at the command prompt type in, netsh firewall set opmode disable, and press Enter.

by gergerdotcom

the command line, "netsh firewall set opmode disable" did really work.

but how about if its a remote PC ... i mean is it still applicable?

cheers!

by gergerdotcom

ahhhhh .... i see:)

well, actually ... i'm just trying to figure out how my colleague was able to disable my firewall "ON" into "off"-state.

when i asked him afterwards, he only said that he uses some kind of script he created. now, i'm not sure if its really the effect of the script he created.

does he perhaps uses a 3rd party software?

but to give a background, he is a SysAd in our company. so does it follows that he can manipulate by controlling our firewall by remotely disabling it through Administrative-rights given to him?

does Windows Server 2003 has this kind of feature to remotely disable the firewall from its each user(s) account?

hmmmmmm ... quite troubling, isn't it.

by rob miners

can be achieved by Group Policy. It can also be achieved by Remote Desktop. A script could be incorporated into a Logon Script therefore it is running Locally when the User logs on.

by gergerdotcom

do u have any knowledge about Logon Script and how it is being incorporated when the computer start?

cheers!

by rob miners

and a couple of samples.

VB Script to disable Local Firewall

Set objFirewall = CreateObject("HNetCfg.FwMgr")
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile

objPolicy.FirewallEnabled = FALSE

Batch Command to disable Local Firewall

@echo off
C:
netsh firewall set opmode disable
goto END

:END

http://www.rlmueller.net/LogonScriptFAQ.htm

by gergerdotcom

hello true blue:)

is their a script or synthax that can be inputted in command prompt?

i mean i'm not that familiar with VB so perhaps their must be some equivalent for it in DOS.

by the way, thanks really for the Script u shared to disable Local Firewall.

cheers!

by rob miners

have to copy the script or batch file to the remote PC and be able to run it or logon to the remote PC and use the command line, script or batch. Very easy to do if you are on a Domain. You need to be able to access the remote PC.

This discussion is closed to new replies.