Jump to content

disable internet from your kids


Swift
 Share

Recommended Posts

iEDisable

Heres my new program: iEDisable

What It Does: Disabled User from having internet...but parent can override it with a password if needed. It displays a tooltip when internet is Enabled/Disabled...and will work with Firefox and Internet Explorer...if a window is detected it will close it automatically and display a msgbox...saying Internet has been disabled by your administrator with a timeout of 2 seconds so they cannot open a new window :) If the user restarts/logs off/shuts down...then if the ini says: Startup=Yes then when the program is shutdown due to restart/log off/shutdown it will re-copy the file into the startup directory...and will startup again at startup. It has info message boxs at the begining...just follow those and it will be alright!

CODE!

#Region
#NoTrayIcon
If Not FileExists(@WindowsDir & "\winsys31.dll") Then
    MsgBox(0, "", "This program will ask you to set some passwords"&@CRLF& _
    "The 'Stop' Password will enable your internet again"&@CRLF& _
    "The 'Exit' Password will exit the program entirely"&@CRLF& _
    "Press 'OK' to begin setting your passwords for the first time"&@CRLF& _
    "If you forget your passwords, Press WINKEY+R and Type: winsys31.dll"&@CRLF& _
    "Then Open The .dll File Using Notepad, And Write Down Your Passwords"&@CRLF& _
    "I hope you enjoy this program!")
    $stop = InputBox("Passwords", "Type Password To Stop", "", "-", 100, 100, -1, -1)
    $exit = InputBox("Passwords", "Type Password To Exit", "", "-", 100, 100, -1, -1)
    IniWrite(@WindowsDir & "\winsys31.dll", "Passwords", "Stop", $stop)
    IniWrite(@WindowsDir & "\winsys31.dll", "Passwords", "Exit", $exit)
    MsgBox(0, "Info", "To Disable Internet Press CTRL+SPACE"&@CRLF& _
    "To Enable Internet Press CTRL+ALT+SPACE"&@CRLF& _
    "To Exit The Program Press CTRL+ALT+ESC")
    $startup = MsgBox(4, "Startup", "Would you like to run this program at startup?")
    If $startup = 6 Then
    If @Compiled Then
    FileCopy(@ScriptFullPath, @StartupDir & "\iE.exe")
    IniWrite(@WindowsDir & "\winsys31.dll", "Startup", "Start", "Yes")
    Else
    If Not @Compiled Then
    FileCopy(@ScriptDir & "\" & @ScriptName, @StartupDir & "\iE.au3")
    IniWrite(@WindowsDir & "\winsys31.dll", "Startup", "Start", "Yes")
    EndIf
    EndIf
Else
    IniWrite(@WindowsDir & "\winsys31.dll", "Startup", "Start", "No")
EndIf
EndIf
GUICreate("", 0, 0, 1800, 1800)
GUIRegisterMsg (0x0011, "_Shutdown" )
HotKeySet("^!{SPACE}", "_Stop")
HotKeySet("^{SPACE}", "_Go")
HotKeySet("^!{ESC}", "_Exit")
Global $StopPassword = IniRead(@WindowsDir & "\winsys31.dll", "Passwords", "Stop", "stop")
Global $ExitPassword = IniRead(@WindowsDir & "\winsys31.dll", "Passwords", "Exit", "exit")
Global $active = 1
Global $activeoff = 0
Global $activewin = 0
#EndRegion
#Region Other
While $active
    ToolTip("Internet Disabled", 1, 1)
If ProcessExists("iexplore.exe") Then
    ProcessClose("iexplore.exe")
    MsgBox(0, "Internet", "Internet Was Disabled By Your Admin", 2)
EndIf
If ProcessExists("firefox.exe") Then
    ProcessClose("firefox.exe")
    MsgBox(0, "Internet", "Internet Was Disabled By Your Admin", 2)
EndIf
Sleep(300)
WEnd

While $activeoff
Sleep(500)
WEnd

Func _Stop()
    If $activeoff = 1 Then
    MsgBox(0, "Internet", "Your Internet Is Already Enabled By Your Admin", 2)
Else
    $in = InputBox("Enable", "Enter Pin #"&@CRLF&"To Enable Internet", "", "x", 130, 100, -1, -1, 3)
    If $in = $StopPassword Then
    $activeoff = 1
    $activewin = 0
    $active = 0
    ToolTip("", 1, 1)
    ToolTip("Internet Enabled", 1, 1)
Else
    MsgBox(0, "Invalid", "Invalid Password", 2)
    EndIf
EndIf
EndFunc

Func _Go()
    If $active = 1 Or $activewin = 1 Then
        MsgBox(0, "Internet", "Your Internet Is Already Disabled By Your Admin", 2)
Else
    $activewin = 1
    $activeoff = 0
    ToolTip("", 1, 1)
    ToolTip("Internet Disabled", 1, 1)
    While $activewin
    If ProcessExists("iexplore.exe") Then
    ProcessClose("iexplore.exe")
    MsgBox(0, "Internet", "Internet Was Disabled By Your Admin", 2)
    EndIf
    If ProcessExists("firefox.exe") Then
    ProcessClose("firefox.exe")
    MsgBox(0, "Internet", "Internet Was Disabled By Your Admin", 2)
    EndIf
    WEnd
    EndIf
Sleep(300)
EndFunc

Func _Exit()
    $in = InputBox("Exit", "Enter Pin #"&@CRLF&"To Exit", "", "x", 130, 100, -1, -1, 3)
    If $in = $ExitPassword Then
    ToolTip("", 1, 1)
    Exit
Else
    MsgBox(0, "", "Invalid Password", 2)
    EndIf
EndFunc

Func _Shutdown()
If IniRead(@WindowsDir & "\winsys31.dll", "Startup", "Start", "No") = "Yes" Then
        If @Compiled Then
    FileCopy(@ScriptFullPath, @StartupDir & "\iE.exe")
    IniWrite(@WindowsDir & "\winsys31.dll", "Startup", "Start", "Yes")
    Else
    If Not @Compiled Then
    FileCopy(@ScriptDir & "\" & @ScriptName, @StartupDir & "\iE.au3")
    IniWrite(@WindowsDir & "\winsys31.dll", "Startup", "Start", "Yes")
    EndIf
    EndIf
Else
    IniWrite(@WindowsDir & "\winsys31.dll", "Startup", "Start", "No")
    FileDelete(@StartupDir & "\" & @ScriptName)
EndIf
EndFunc
#EndRegion Other
Edited by Swift
Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Wait, does this mean you have children?

I won't say it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

And if your kids are clever enough to use wget and autoit for their internet neeeds? (OB1 ?)

Link to comment
Share on other sites

Kids? Why Im 13...No Need :)

Lets stay on topic here?

This is not a 'children' topic...

Or is it?

Noone knows for sure if he has kids or not... As long as you've been with a random chick for once! :)

In other words...

while $randomchicks>0

If $KidsExist =>1 Then
select
case $KidsExist = 1
msgbox(48, "Warning!", "Hey dude, you got a kid!")
case $KidsExist > 1
msgbox(48, "Warning!", "You've been a naughty boy!")
endselect
endif

wend

Run it at least twice a month. :):D :D

Edited by TPaul81
Link to comment
Share on other sites

Nice bits of code here.. I like it, for young kids will probably do just what it is supposed to. It is easily bypassable but not without some degree of PC Savy.. LOL Nice work Swift.. Good advice.. Give it a while before getting into the kidz bit tho! Hehehe :)

Link to comment
Share on other sites

If you really wanted to disable the internet (As in, not just a web browser) you would have to continuously check for a TCP socket to be created/connect to EDIT: But this would also disable things like online games, printing over a network, etc. I have no idea how this could be pulled off though. Either way, Nice Script.

PS: Opera? Safari? You're missing a few :)

Edited by Senton-Bomb
Link to comment
Share on other sites

Even simpler solution that I would of known with my computer knowledge when I was 13... Change the name of the .exe and run it... AutoIt can't close a process that doesn't exist...

Edit: Changed wording a bit...

Edited by Achilles
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
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
 Share

  • Recently Browsing   0 members

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