Solved

Deactivating windows firewall with script

Posted on 2007-04-02
5
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

751 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