Zohar Posted November 5, 2015 Posted November 5, 2015 (edited) Hi I am using Windows XP SP3,and I have a Network Connection called "Local Area Network" that represents my Ethernet NIC.How can I Start and Stop this connection, via AutoIt? Thank you Edited November 30, 2015 by Zohar
spudw2k Posted November 5, 2015 Posted November 5, 2015 I've got an old thread with a script that may work with Windows XP still. You are welcome to check it out to get some ideas.https://www.autoitscript.com/forum/topic/52886-quicknic/I believe you can also use the netsh command line utility to enable and/or disable a network interface. Also, just a comment...Windows XP? *shivers It's Highly vulnerable. nothing personal....just the computer security side of me freaking out Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
Zohar Posted November 6, 2015 Author Posted November 6, 2015 (edited) Thank you spudw2k In addition to the vbScript, are there other options?The Shell option doesn't work, because it seems it accepts Enabling/Disabling all network connections except the LAN one.. Edited November 6, 2015 by Zohar
Danyfirex Posted November 6, 2015 Posted November 6, 2015 Hello https://www.autoitscript.com/forum/topic/165837-enabledisable-network-connection/ Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Gianni Posted November 6, 2015 Posted November 6, 2015 here another way using "netsh": Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
pcjunki Posted November 6, 2015 Posted November 6, 2015 Run(@ComSpec & ' /c ' & 'netsh interface set interface name="local area connection" admin=disable')Run(@ComSpec & ' /c ' & 'netsh interface set interface name="local area connection" admin=enable')
Zohar Posted November 6, 2015 Author Posted November 6, 2015 (edited) Thank you, but as written before,the netsh option works on all items except the "Local Area Connection" item..(it also writes it in the help for netsh) I don't know why they decided to exclude the "Local Area Network" item from all the rest.. See this screenshot:http://s1.postimg.org/854xb8t3j/netsh.png Edited November 6, 2015 by Zohar
pcjunki Posted November 6, 2015 Posted November 6, 2015 in your original post you asked to enable/disable the nic called "Local Area Network"did you try the code I posted at all?
Zohar Posted November 6, 2015 Author Posted November 6, 2015 did you try the code I posted at all?Of course And it doesn't work, for the reason written in the screenshot I supplied in the last post..
jguinch Posted November 6, 2015 Posted November 6, 2015 Also, you can use my Network configuration UDF : https://www.autoitscript.com/forum/topic/155539-network-configuration-udf/#RequireAdmin #Include "network.au3" _DisableNetAdapter("Local Area Network") ; or _EnableNetAdapter("Local Area Network") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
pcjunki Posted November 6, 2015 Posted November 6, 2015 (edited) you only ran "netsh interface set interface" try running (copy as is)netsh interface set interface name="local area connection" admin=disable Edited November 6, 2015 by pcjunki
Zohar Posted November 6, 2015 Author Posted November 6, 2015 (edited) you only ran "netsh interface set interface"No, I ran both commands The shorter one was just to show what the help says, regarding not allowing changing the state of the LAN connection, for some reason that they have..Here's the full command's result: jguinch:Thank you very much, interesting to find another method.. Edited November 6, 2015 by Zohar
Gianni Posted November 6, 2015 Posted November 6, 2015 (edited) ... could you try this:within a cmd prompt run as administrator type:netsh interface show interfaceabove command should show you the exact name of your interface(s)now type this command:netsh interface set interface "Local Area Network" disabledwhere the name of the interface must be exactly like shown in previous show interface command.(in your command in post #13 you typed disable instead of disabled (you missed the last d) Edited November 6, 2015 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
JohnOne Posted November 6, 2015 Posted November 6, 2015 The netsh commands definitely work, I've tried them before on windows 10 and windows 7. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Zohar Posted November 6, 2015 Author Posted November 6, 2015 ... could you try this:within a cmd prompt run as administrator type:netsh interface show interfaceabove command should show you the exact name of your interface(s)now type this command:netsh interface set interface "Local Area Network" disabledwhere the name of the interface must be exactly like shown in previous show interface command.(in your command in post #13 you typed disable instead of disabled (you missed the last d)Regarding the interface names - yes I am complately aware of it, and I used the correct name.If I try to write an incorrect name, I get"An interface with this name is not registered with the router." And If I try with the correct name, then it simply shows me the help again.(probably to remind me that the LAN interface cannot be worked on - see the screenshot: http://s1.postimg.org/854xb8t3j/netsh.png ) Also, I tried again with disabled, and no change unfortunately.. The netsh commands definitely work, I've tried them before on windows 10 and windows 7.Maybe this exclusion of the LAN interface is only in Windows XP?Because it really doesn't work here..
pcjunki Posted November 6, 2015 Posted November 6, 2015 lets see a screenshot when you run the commandnetsh interface set interface name="local area connection" admin=disablewe need to see the cmd error
JohnOne Posted November 6, 2015 Posted November 6, 2015 He has in post 13 and it is wrong. I just ran thisnetsh interface set interface "Local Area Network" disabled AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
pcjunki Posted November 6, 2015 Posted November 6, 2015 dang... I didn't see that, I don't have a xp machine here at work, wonder if it's different, but I don't think so
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