Colduction Posted March 26, 2020 Posted March 26, 2020 (edited) Hi AutoIt Programmers! I've seen a code that gives Name of Group by writing it's group's SID, but this one response very slower than Windows Command-Line WMIC Func _GetLocalGroupName($sSID = 'S-1-5-18') $objWMIService = ObjGet ("winmgmts:\\" & @ComputerName & "\root\cimv2") $colItems = $objWMIService.ExecQuery('SELECT Name FROM Win32_Group where SID="' & $sSID & '"') For $GroupNames in $colItems MsgBox (0,"",$GroupNames.Name) ExitLoop Next EndFunc I don't want call and use any third-party programs even CMD, i just want use from Windows API, netapi32.dll or AutoIt Functions (Standalone). Do you have any idea to improve speed/performance of this code? I'll happy of your comments ====================== SOLOUTION by @Subz ====================== Edited March 26, 2020 by Colduction
argumentum Posted March 26, 2020 Posted March 26, 2020 https://www.autoitscript.com/forum/topic/117800-solved-get-the-workgroup-name/?do=findComment&comment=820312 Colduction 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Colduction Posted March 26, 2020 Author Posted March 26, 2020 (edited) 1 hour ago, argumentum said: https://www.autoitscript.com/forum/topic/117800-solved-get-the-workgroup-name/?do=findComment&comment=820312 Thanks @argumentum, that code is very speedy. i measured and compared that with _GetLocalGroupName() by calling 500 times and results was amazing!: #Fastest Function: "netGetJoinInfo" 1) "_GetLocalGroupName" time elapsed: (8836.4114) ms 2) "netGetJoinInfo" time elapsed: (601.2863) ms But it's not what i want, it's just similar, anyway thanks for your comment ❤ Edited March 26, 2020 by Colduction argumentum 1
argumentum Posted March 26, 2020 Posted March 26, 2020 2 minutes ago, Colduction said: "netGetJoinInfo" time elapsed: (601.2863) ms took 2 ms in my PC. 600 ms. is very slow for a Netapi32.dll call. Colduction 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Colduction Posted March 26, 2020 Author Posted March 26, 2020 (edited) 5 minutes ago, argumentum said: took 2 ms in my PC. 600 ms. is very slow for a Netapi32.dll call. Yeah i know @argumentum, i've called them for 500 times Edited March 26, 2020 by Colduction argumentum 1
Colduction Posted March 26, 2020 Author Posted March 26, 2020 Thanks to @Subz about his old comment on my blocked account I measured his codes by calling 2000 times, it's faster than netapi32.dll and WMI objects: #Fastest Function: "_GetAccountName" 1) "_GetAccountName" time elapsed: (359.1129) ms ; @Subz codes 2) "netGetJoinInfo" time elapsed: (2304.4145) ms argumentum 1
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