Jump to content

Automate Disabling Windows Firewall


Constantine

Recommended Posts

I need to stop the Windows Firewall/Internet Connection Sharing service automatically. I can use a registry injection (if someone knows of a key) or I can use a command-line "Net Stop" command. I'm also open to other ideas.

What I am trying to accomplish is creating an account that will do everything we need on a new PC to push it out into production. The lady we have doing it knows nothing about computers, but we have no other option so she is doing it.

The only two things I have remaining. 1 is Windows Firewall. I found a reg-key to disabled it, but it does not stop the service, you still have to manually stop it, then it stays stopped.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\SharedAccess]
"Start"=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess]
"Start"=dword:00000004

My second issue. I need to uninstall microsoft games as we push out the computers. Certain people get to keep them, You know how that politcal issue works. Doctors are the lords of the universe and should get to do whatever they want or something. But, for the most part I need to uninstall it. Anyone know of a way of automating this process? I tried just deleting the executables, but they just come back.Every microsoft game I delete the executable for, after about 10 seconds, windows replaces it back into the system 32 folder. Most of you probably think i'm a moron if you havn't seen this, but try it. (It is atleast the case with Dell's)

Link to comment
Share on other sites


@echo off

echo ------------------------------
echo Stopping "Windows Firewall/Internet Connection Sharing (ICS)"
sc stop SharedAccess > nul
net start | find "Windows Firewall/Internet Connection Sharing (ICS)" > nul
if errorlevel 1 echo "Windows Firewall/Internet Connection Sharing (ICS)" was stopped successfully
echo Disabling "Windows Firewall/Internet Connection Sharing (ICS)"
sc config SharedAccess start= disabled > nul

echo ------------------------------
echo Press any key to close . . .
pause > nul

Once you do that Security center will start nagging people that no firewall in turned on so id run this too

@echo off

echo ------------------------------
echo Stopping "Security Center"
@sc stop wscsvc > nul
net start | find "Security Center" > nul
if errorlevel 1 echo "Security Center" was stopped successfully
echo Disabling "Security Center"
@sc config wscsvc start= disabled > nul

echo ------------------------------
echo Press any key to close . . .
pause > nul

and this will kill MSN messenger and games

@echo off
echo Uninstalling MSN/Windows Messenger... (choose no if asked to reboot)
RunDll32 advpack.dll,LaunchINFSection %windir%\inf\msmsgs.inf,BLC.Remove

echo Uninstalling Freecell... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection FreecellUninstall 132 games.inf

echo Uninstalling Minesweeper... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection MinesweeperUninstall 132 games.inf

echo Uninstalling Solitare... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection SolitaireUninstall 132 games.inf

echo Uninstalling Pinball... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection Pinball.Remove 132 pinball.inf

echo ------------------------------
echo Press any key to close . . .
pause > nul

just put 1 or all of those pieces of code into a .bat file and have your lady run from an administrator account

Edited by geek
Link to comment
Share on other sites

That is the most fantastic thing I've ever seen. Seriously!

I figured out how to make it do Hearts and Spider Solitaire but I am having a little trouble getting it to uninstall the Internet Games or Zone Games whichever you want to call them. Also Outlook Express. Any tips there?

Also is there any way for the script not to puase? To just go ahead and run strait through all of it?

Edited by Constantine
Link to comment
Share on other sites

here this one should do everything

@echo off

echo ------------------------------
echo Stopping "Windows Firewall/Internet Connection Sharing (ICS)"
sc stop SharedAccess > nul
net start | find "Windows Firewall/Internet Connection Sharing (ICS)" > nul
if errorlevel 1 echo "Windows Firewall/Internet Connection Sharing (ICS)" was stopped successfully
echo Disabling "Windows Firewall/Internet Connection Sharing (ICS)"
sc config SharedAccess start= disabled > nul
echo ------------------------------

echo Stopping "Security Center"
@sc stop wscsvc > nul
net start | find "Security Center" > nul
if errorlevel 1 echo "Security Center" was stopped successfully
echo Disabling "Security Center"
@sc config wscsvc start= disabled > nul
echo ------------------------------

echo Uninstalling MSN/Windows Messenger... (choose no if asked to reboot)
RunDll32 advpack.dll,LaunchINFSection %windir%\inf\msmsgs.inf,BLC.Remove

echo Uninstalling Freecell... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection FreecellUninstall 132 games.inf

echo Uninstalling Minesweeper... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection MinesweeperUninstall 132 games.inf

echo Uninstalling Solitare... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection SolitaireUninstall 132 games.inf

echo Uninstalling Spider Solitare... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection SpiderUninstall 132 games.inf

echo Uninstalling Hearts... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection HeartsUninstall 132 games.inf

echo Uninstalling Pinball... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection Pinball.Remove 132 pinball.inf

echo Uninstalling Zone Games... (choose no if asked to reboot)
Rundll32 setupapi,InstallHinfSection ZoneUninstall 132 igames.inf

echo Removing Games Folder from Start Menu
rd /S /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Games"

echo ------------------------------
echo Press any key to close . . .
pause > nul

Just remove the last 3 lines if you want the window to close by itself

Link to comment
Share on other sites

Here is a vbs script to turn off the Firewall, and it should unistall the games, thanks to geek for providing the code

for the unistall. I could not figure out how to disable the security center with a script.

Save As Configure.vbs

'/-> Disable Windows Firewall
On Error Resume Next
Dim ObjFw, StrFw
Set StrFw = CreateObject("HNetCfg.FwMgr")
Set ObjFw = StrFw.LocalPolicy.CurrentProfile
If ObjFw.FirewallEnabled = True Then ObjFw.FirewallEnabled = False End If
'/-> Games Uninstall Section
Dim Act, Arg1, Fso, Fldr, StrCmd
Dim Cmd :Cmd = Array(_
"RunDll32 advpack.dll,LaunchINFSection %windir%\inf\msmsgs.inf,BLC.Remove-Messenger",_
"Rundll32 setupapi,InstallHinfSection FreecellUninstall 132 games.inf-FreeCell",_
"Rundll32 setupapi,InstallHinfSection MinesweeperUninstall 132 games.inf-MineSweeper",_
"Rundll32 setupapi,InstallHinfSection SolitaireUninstall 132 games.inf-Solitaire",_
"Rundll32 setupapi,InstallHinfSection SpiderUninstall 132 games.inf-Spider",_
"Rundll32 setupapi,InstallHinfSection HeartsUninstall 132 games.inf-Hearts",_
"Rundll32 setupapi,InstallHinfSection Pinball.Remove 132 pinball.inf-Pinball",_
"Rundll32 setupapi,InstallHinfSection ZoneUninstall 132 igames.inf-Zone Games")
Set Act = CreateObject("Wscript.Shell")
For Each StrCmd In Cmd
Arg1 = Split(StrCmd,"-")
Act.Popup "Preparing to Uninstall " & Arg1(1) & vbcrlf &_
"Select No if ask to Reboot the Computer",5,"Unistall",4128
Act.Run(Arg1(0)),1,True
Next
'/-> Remove Games Folder
Set Fso = CreateObject("Scripting.FileSystemObject")
Fldr = Act.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\Start Menu\Programs\Games")
If Fso.FolderExists(Fldr) Then Fso.DeleteFolder(Fldr) End If

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...