Solved

Deactivating windows firewall with script

Posted on 2007-04-02
5
306 Views
Last Modified: 2010-04-16
Hello Experts,
Does anyone know of a way to deactivate windows firewall with script (batch, vbscript).
Or perhaps any other way to do it on all workstations in my network remotely (500 computers).
Thanks


0
Comment
Question by:lescluster
  • 4
5 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18838946
Place this in a batch file:

@echo off
sc config sharedaccess start= disabled
net stop sharedaccess
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18838961
If you're only looking to disable it, then you can do something like this if you have a list of computers...

For /f %%a in (C:\Computers.txt) do sc \\%%a config sharedaccess start= disabled

That will loop through all computers and disable the service...
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18838966
You could subsequently use psexec to stop the service too, if you're not opposed to using it...

For /f %%a in (C:\Computers.txt) do (
  sc \\%%a config sharedaccess start= disabled
  psexec \\%%a net stop sharedaccess
)
0
 

Author Comment

by:lescluster
ID: 18838994
Wow -  perfect -  the last solution is exactly what I need -  you are THE MAN -  thanks much
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18839009
Happy to help - thanx for the grade! :^)
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question