colombeen Posted November 16, 2015 Posted November 16, 2015 (edited) Hi guysI've been looking around to enable/disable network cards using WMI but so far the only way i could get it to work was with this :RunWait(@ComSpec & " /c " & "WMIC PATH Win32_NetworkAdapter WHERE Index=" & $NetAdp_CurrID & " CALL " & $action, "", @SW_HIDE)The $NetAdp_CurrID var would be the index of the network card and the $action var would be enable or disable in my line of code.I know it's possible to do this with wmi without using cmd but i can't figure out how.Anyone who has the answer to my problem?I've tried with using the wmi query and adding .enable() and .disable() at the end but that doesn't work (or at least not for me) Edited November 16, 2015 by colombeen more info
TouchOdeath Posted November 16, 2015 Posted November 16, 2015 This should be what your looking for: https://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85).aspxAn example on this page: https://msdn.microsoft.com/en-us/library/windows/desktop/aa390385(v=vs.85).aspxbtw whats wrong with doing it with wmic/dos?
colombeen Posted November 16, 2015 Author Posted November 16, 2015 This should be what your looking for: https://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85).aspxAn example on this page: https://msdn.microsoft.com/en-us/library/windows/desktop/aa390385(v=vs.85).aspxbtw whats wrong with doing it with wmic/dos?to better capture errors
jguinch Posted December 25, 2015 Posted December 25, 2015 You can call WMI methods directly with AutoIt.Look at my network UDF (https://www.autoitscript.com/forum/topic/155539-network-configuration-udf/) : _EnableNetAdapter / _DisableNetAdapter Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
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