Need a script to turn off firewall and turn on file sharing and discovery?
I need a script to run to turn off the firewall and turn on file sharing and discovery?
Please help.
0 Comments
[ + ] Show comments
Answers (5)
Answer Summary:
Please log in to answer
Posted by:
jknox
10 years ago
You didn't mention what operating system, but you should be able to run a batch file similar to this:
netsh firewall set opmode disable
netsh firewall set service type=fileandprint mode=enable profile=all
netsh advfirewall firewall set rule group=”network discovery” new enable=yes
Comments:
-
Thanks, can you should me how to create a Batch file. I have used VB scripts and new in creating batch files to run through online shell. - Kdebiasse 10 years ago
-
I would use an online kscript and select "run a batch file" under the On Success portion of the Task.
I would also suggest to make sure the commands I posted work properly on a test machine before creating the kscript. - jknox 10 years ago-
is there away to do this silently no pop up cmd screen - Kdebiasse 10 years ago
Posted by:
spartacus
10 years ago
Wouldn't this be better handled by Group Policy ?
Spartacus
Spartacus
Comments:
-
It could, but our policy people are not in I would like to handle it on the PC level - Kdebiasse 10 years ago
Posted by:
EdT
10 years ago
Posted by:
Badger
10 years ago
getting CMDs to run without the pop is a bit tricky.
I have a vbs that can call a CMD (or any other exe etc), but it always seems a bit wrong in my head, you might just aswell create a vbs that does it all, anyway....
here is the script, you need to change the objshell.run bit, to your target, the name of your CMD file, or any other exe.
on Error Resume Next
' Declare Constants and Variables
Set objShell = CreateObject ("WScript.Shell")
objShell.Run "Firewall.cmd",0 , True
' Clean up
set objShell = Nothing