/build/static/layout/Breadcrumb_cap_w.png

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:
Posted by: jknox 9 years ago
Red Belt
2
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 9 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 9 years ago
      • is there away to do this silently no pop up cmd screen - Kdebiasse 9 years ago
Posted by: spartacus 9 years ago
Black Belt
0
Wouldn't this be better handled by Group Policy ?

Spartacus

Comments:
  • It could, but our policy people are not in I would like to handle it on the PC level - Kdebiasse 9 years ago
Posted by: EdT 9 years ago
Red Belt
0
This is pretty much unavoidable as you are calling command line utilities. The changes are likely to be recorded in the registry so if you capture the changes made by each script line then you can add them directly without running the utilities.
Posted by: Kdebiasse 9 years ago
9th Degree Black Belt
0
script is working thank you
Posted by: Badger 9 years ago
Red Belt
0

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

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ