zxc3 Posted June 1, 2005 Share Posted June 1, 2005 Prompt, who knows the command (program) switching off Internet connection ?! Link to comment Share on other sites More sharing options...
buzz44 Posted June 1, 2005 Share Posted June 1, 2005 Open your registry and find the key below. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings Change the value of "ProxyEnable" and set it to "1". Change the value of "ProxyServer" and set it to an IP address and port that is invalid on your network such as "10.0.0.1:5555" (i.e. "IP:Port"). By changing these settings Internet access will be disabled for any applications that rely of the Microsoft proxy server information such as Internet Explorer, Microsoft Office, Opera browser. To stop users from modifying the proxy settings add these restrictions to disable changes to the Internet configuration. Find or create the key below: HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel Create two DWORD values named "Connection Settings" and "Connwiz Admin Lock" and set them both to "1". To remove the restriction, set the proxy settings back to their original values and delete the policy values. Note: The change will take effect immediately for any new browser windows, existing Internet Explorer sessions will not be affected until the browser is closed and reopened. qq Link to comment Share on other sites More sharing options...
zxc3 Posted June 1, 2005 Author Share Posted June 1, 2005 Open your registry and find the key below.HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet SettingsChange the value of "ProxyEnable" and set it to "1". Change the value of "ProxyServer" and set it to an IP address and port that is invalid on your network such as "10.0.0.1:5555" (i.e. "IP:Port").By changing these settings Internet access will be disabled for any applications that rely of the Microsoft proxy server information such as Internet Explorer, Microsoft Office, Opera browser.To stop users from modifying the proxy settings add these restrictions to disable changes to the Internet configuration.Find or create the key below:HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control PanelCreate two DWORD values named "Connection Settings" and "Connwiz Admin Lock" and set them both to "1".To remove the restriction, set the proxy settings back to their original values and delete the policy values.Note: The change will take effect immediately for any new browser windows, existing Internet Explorer sessions will not be affected until the browser is closed and reopened.<{POST_SNAPBACK}>Thank you , but something is easier, I do not need to block the Internet for users,Simply to break off connection. Link to comment Share on other sites More sharing options...
buzz44 Posted June 1, 2005 Share Posted June 1, 2005 (edited) Thank you , but something is easier, I do not need to block the Internet for users,Simply to break off connection.<{POST_SNAPBACK}>Please explain more... Edited June 1, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
/dev/null Posted June 1, 2005 Share Posted June 1, 2005 Prompt, who knows the command (program) switching off Internet connection ?!might try this. Will disable your network interface. Run it once to disable.Run it again to re-enable.$windowtitle = "Network Connections" $adapter = "Your adapter name here"; <<=== Change this !! Run("control.exe ncpa.cpl") WinWait($title) ControlListView($title, "", "SysListView321", "Select", ControlListView($title,"","SysListView321","FindItem",$adapter) ) WinWaitActive($title) ControlSend($title, "", "SysListView321", "+{F10}{DOWN}{ENTER}") WinClose($title)CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Westi Posted June 1, 2005 Share Posted June 1, 2005 If you use a dialin connection, try:rasdial "your connection" /disconnect Link to comment Share on other sites More sharing options...
jdickens Posted June 2, 2005 Share Posted June 2, 2005 (edited) This may be what you need: $FALSE = 0 $TRUE = NOT $FALSE Func SOff() RunWait("ipconfig /release", "c:/", @SW_HIDE) ProcessWaitClose("ipconfig.exe") Return $FALSE EndFunc ;==>SOff Func SOn() RunWait("ipconfig /renew", "c:/", @SW_HIDE) ProcessWaitClose("ipconfig.exe") Return $TRUE EndFunc ;==>SOn Reply if you require explanation. J Edited June 2, 2005 by jdickens If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
zxc3 Posted June 3, 2005 Author Share Posted June 3, 2005 Thanks for your advice. I used the following program for an input in the Internet (for Dial up) for already open window Internet Explorer. I understand, what is it silly. Prompt as standardly to connect and disconnect Internet.$handle =WinGetHandle("The page", "") While $J <= 3ControlSend($handle, "", "Internet Explorer_Server1", "{F5}")sleep(1000)ControlSend($handle, "", "Internet Explorer_Server1", "{BACKSPACE}")send("{ENTER}") $J=$J+1 wend Link to comment Share on other sites More sharing options...
S0mbre Posted March 26, 2009 Share Posted March 26, 2009 Hi All!I'm a newcomer to AutoIt (got wise to it yesterday), but have already managed to practice some coding. Since one of my urging tasks was similar to this one discussed here (toggle LAN connection on and off), I spent some time trying to script that. I've tried some solutions offered here: http://www.autoitscript.com/forum/index.php?showtopic=12034 and here: http://www.autoitscript.com/forum/index.php?showtopic=12645, but they didn't work too fine. So I've found what seems a more robust solution. I don't know if it works on any other OSs other than mine (Windows XP SP3), but it seems to be entirely independent of local languages (it doesn't use "verbs" and system folder names). I just found a free Microsoft product - a console-run device manager called devcon (try googling it or searching in MSDN). This tool can enable / disable any device using WinAPI and given the device's ID (a string value). So my task in AutoIt boiled down to writing a wrapper.And here it is:expandcollapse popup#Region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=LAN_Control_ENG.exe #AutoIt3Wrapper_Run_Tidy=y #EndRegion;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> Global Const $DEVCON = @ScriptDir & "\devcon.exe" Func Connect($bConnect = True) If $bConnect = True Then If ShellExecute($DEVCON, "enable ms_pschedmp", "", "", @SW_HIDE) = 1 Then; "ms_pschedmp" is the LAN devices ID Return True Else Return False EndIf Else If ShellExecute($DEVCON, "disable ms_pschedmp", "", "", @SW_HIDE) = 1 Then; "ms_pschedmp" is the LAN devices ID Return True Else Return False EndIf EndIf EndFunc ;==>Connect $gui = GUICreate("LAN Control", 155, 80) $gui_label = GUICtrlCreateLabel("Choose option:", 30, 10) $gui_b_OK = GUICtrlCreateButton("Enable LAN", 5, 40, 70, 30) $gui_b_Cancel = GUICtrlCreateButton("Disable LAN", 80, 40, 70, 30) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $gui_b_OK If Connect() Then MsgBox(64, "OK!", "LAN enabled!") ExitLoop Else MsgBox(48, "Error!", "An error occurred!") ExitLoop EndIf Case $msg = $gui_b_Cancel If Connect(False) Then MsgBox(64, "OK!", "LAN disabled!") ExitLoop Else MsgBox(48, "Error!", "An error occurred!") ExitLoop EndIf Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEndHere's a RAR file containing the above source code, a compiled EXE, and devcon (for i386 systems): http://narod.ru/disk/7051598000/LanControl.rar.htmlPlease comment! Link to comment Share on other sites More sharing options...
SpookMeister Posted March 26, 2009 Share Posted March 26, 2009 You might want to make a post in the Examples forum to get comments etc... [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
S0mbre Posted March 27, 2009 Share Posted March 27, 2009 You might want to make a post in the Examples forum to get comments etc...I'll do that as soon as the admins let me post in the Examples Link to comment Share on other sites More sharing options...
rajeshontheweb Posted May 5, 2009 Share Posted May 5, 2009 hi guys, i just noticed this thread, but there is a WMI service option also to disable adapters. i will post the information here soon. based on this, http://msdn.microsoft.com/en-us/library/aa394216(VS.85).aspx i actually use my script to enumerate the adapters, i will do the mods to enable or disable the network adapter, one small note S0mbre, if devs dont mistake me, as i am always concerned about EULA issues, i would like to mention, just post the link to dev con download and post your script that will free your script (which is for personal use of who ever downloads it) from any redistribution related issues. pls dont mistake me. Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now