coucou Posted August 2, 2007 Share Posted August 2, 2007 Hi, How to block any connexion toward outside during a software installation. In fact, i wrote a script for silent install software, and i have to manually disable my wireless connexion in order to install it then manually enable the wireless connexion after that software installed. BTW, i noticed that NO iexplorer process opened. Regards coucou Link to comment Share on other sites More sharing options...
cramaboule Posted August 2, 2007 Share Posted August 2, 2007 Hi,How to block any connexion toward outside during a software installation.In fact, i wrote a script for silent install software, and i have to manually disable my wireless connexion in order to install it then manually enable the wireless connexion after that software installed. BTW, i noticed that NO iexplorer process opened.RegardscoucouYee I am looking as well for this kind of "tool" My Autoit programs: MAC Address - - Delete Temp Files - - Ping Test - - Play Video with VLC full screen dual monitors - - Set IP - - Pics Converter - - AutoUpdater - - CPU Usage - - Ending Script Nicely - - GDI+ GUI crossfades (slide transitions) - - Beamer - - Search and Search in Files - - Silent Ninite Others: Export Icons into Dll - - My website Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 2, 2007 Share Posted August 2, 2007 Well, according to the "MS Scripting Guys", you can't.Unless, that is, you are running Vista:expandcollapse popup$RET = _NetworkEnable() MsgBox(64, "Result", "$RET = " & $RET & @CRLF & _ "@error = " & @error & @CRLF & _ "@extended = " & @extended) ; ----------------------------------------------------- ; Function _NetworkEnable() ; Enables/Disables one or all network adapters ; Call with: _NetworkEnable( [$iEnable [, $sName [, $sComputer]]] ) ; Where: $iEnable (optional): 1 (default) = Enable, 0 = Disable ; $sName (optional): The name of an adapter, or an empty string for all (default) ; $sComputer (optional): The name of the computer to operate on. Default = "." ; On success returns 1 and @extended = count of adapters operated on ; On failure retruns 0 and sets @error: ; @error = 1 Failed to connect to WMI ; @error = 2 Query failed to return a collection ; @error = 3 No matching adapter names ; Note: The .enable and .disable methods are not available on versions of Windows before Vista. ; ----------------------------------------------------- Func _NetworkEnable($iEnable = 1, $sName = "", $sComputer = ".") Local $sNetEnabled = "'False'", $objItem, $sObjName = "", $iCount = 0 If Not $iEnable Then $sNetEnabled = "'True'" Local $objWMIService = ObjGet("winmgmts:\\" & $sComputer & "\root\CIMV2") If IsObj($objWMIService) Then Local $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapter Where NetEnabled = " & $sNetEnabled) If IsObj($colItems) Then For $objItem In $colItems $sObjName = $objItem.Name If $sName = "" Or $sName = $sObjName Then $iCount += 1 ConsoleWrite("Name: " & $sObjName & @LF) ConsoleWrite("Description: " & $objItem.Description & @LF) If $iEnable Then $objItem.Enable Else $objItem.Disable EndIf Else ContinueLoop EndIf Next If $iCount Then ; Success, @extended = count Return SetError(0, $iCount, 1) Else ; No matching adapters found Return SetError(3, 0, 0) EndIf Else ; Win32_NetworkAdapter query did not return a collection Return SetError(2, 0, 0) EndIf Else ; Faile to connect to WMI Return SetError(1, 0, 0) EndIf EndFunc ;==>_NetworkEnableI don't have (or want) Vista, so I can't test that adaptation... Let me know if it works. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
coucou Posted August 2, 2007 Author Share Posted August 2, 2007 I don't have Vista neither So... Is there NO issue? coucou Link to comment Share on other sites More sharing options...
John117 Posted August 2, 2007 Share Posted August 2, 2007 PsaltyDS - I don't really need it right now, but do see future purposes. I will test it when I get home this evening, after soccer -Will let you know . . . Link to comment Share on other sites More sharing options...
John117 Posted August 2, 2007 Share Posted August 2, 2007 was just thinking - - why disable the network connection? Why not just check all open ports and write to a file. Have a couple buttons on a gui. One Close, one Open. When you press close, all ports that are open are written. When you press open, the file is read to array and all ports that are in the file are unblocked . . . Would this not work? Link to comment Share on other sites More sharing options...
John117 Posted August 3, 2007 Share Posted August 3, 2007 From reading the code it looks like it records what is open and disables it. Not working on vista $Ret = 1 @error = 0 @Extended = 1 let me know if you need any more testing~ Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 3, 2007 Share Posted August 3, 2007 From reading the code it looks like it records what is open and disables it. Not working on vista $Ret = 1@error = 0@Extended = 1let me know if you need any more testing~Well, the return data says it worked:; On success returns 1 and @extended = count of adapters operated on$RET = 1 means success, and @extended indicates 1 adapter was operated on.Did you check to see if the adapter was, in fact, enabled or disabled after running it? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
John117 Posted August 3, 2007 Share Posted August 3, 2007 ha! -of course I did. I have two, one lan cable, one wireless. I was using the wireless, never went down. The lan cable was not plugged, but I did have network connections open and it never changed to disabled either sorry! Still wondering however, I know that you can open a port with autoit. -seen code to do it. Can you disable them also? If so, why not convert your code to ports instead of network adapters? Then you have a xp/vista code that saves open port data, and disables them. Another button acts as a "recall" closed ports to active . . . -Then again maybe I'm dreaming magic coding here . . . Link to comment Share on other sites More sharing options...
cramaboule Posted August 3, 2007 Share Posted August 3, 2007 Well,... looking at the WEB I found this:Devcon.exehttp://support.microsoft.com/default.aspx?...;NoWebContent=1You will nedd to intall devcon into your windows thendevcon find PCI *devcon disable PCI\.............devcon enable PCI\.............devcon status PCI\..........you can use as well this: http://www.autoitscript.com/forum/index.ph...amp;hl=compinfoanyone got easier ??? My Autoit programs: MAC Address - - Delete Temp Files - - Ping Test - - Play Video with VLC full screen dual monitors - - Set IP - - Pics Converter - - AutoUpdater - - CPU Usage - - Ending Script Nicely - - GDI+ GUI crossfades (slide transitions) - - Beamer - - Search and Search in Files - - Silent Ninite Others: Export Icons into Dll - - My website Link to comment Share on other sites More sharing options...
EvAsion Posted August 5, 2007 Share Posted August 5, 2007 (edited) if you just want to stop all internet connections then do: #include<process.au3> _rundos("ipconfig /release") and to re-enable #include<process.au3> _rundos("ipconfig /renew") edit: this blocks all traffic, not just outgoing just so you know.. Edited August 5, 2007 by EvAsion |-- Periodic Table --||-- Dynamic Class Timetable --||-- Navigation in Counter-Strike --| 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