Gianni Posted April 26, 2014 Share Posted April 26, 2014 (edited) Thanks for the information. Glad to hear you found the problem.I want to understand - "localized strings" means that the strings "SERVICE_NAME" and "DISPLAY_NAME" are called in another language in your system? I need to be sure i understood it correct. right. I changed this line $aResult = StringRegExp($sResult, "(?mi)^(?:SERVICE_NAME|DISPLAY_NAME):\h*(\N+)", 3) in this line (italian locale) $aResult = StringRegExp($sResult, "(?mi)^(?:NOME_SERVIZIO|NOME_VISUALIZZATO):\h*(\N+)", 3) ..... if you want to distribute your scripts all around the world, then you have to consider this situations....... Edited April 26, 2014 by PincoPanco Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Guest Posted April 26, 2014 Share Posted April 26, 2014 right. I changed this line $aResult = StringRegExp($sResult, "(?mi)^(?:SERVICE_NAME|DISPLAY_NAME):\h*(\N+)", 3) in this line (italian locale) $aResult = StringRegExp($sResult, "(?mi)^(?:NOME_SERVIZIO|NOME_VISUALIZZATO):\h*(\N+)", 3) ..... if you want to distribute your scripts world wide, then you have to consider this situations....... Thank you very much! I will continue with this information on another day. Link to comment Share on other sites More sharing options...
Guest Posted May 3, 2014 Share Posted May 3, 2014 (edited) right. I changed this line $aResult = StringRegExp($sResult, "(?mi)^(?:SERVICE_NAME|DISPLAY_NAME):\h*(\N+)", 3) in this line (italian locale) $aResult = StringRegExp($sResult, "(?mi)^(?:NOME_SERVIZIO|NOME_VISUALIZZATO):\h*(\N+)", 3) ..... if you want to distribute your scripts all around the world, then you have to consider this situations....... Thanks for the information.Today I worked on it again.Please check if this code works for you: expandcollapse popup#include <Array.au3> $timer = TimerInit() $Services = _RetrieveRunningServices3() ConsoleWrite("Time: "&TimerDiff($timer)&@CRLF) _ArrayDisplay($Services) Func _RetrieveRunningServices3($Sort = 0) Local $Output[1][2] , $iPid $Output[0][0] = 0 $iPid = Run(@ComSpec & " /c sc query", @SystemDir, @SW_HIDE, 2) If $iPid > 0 Then ProcessWaitClose($iPid) Local $StdoutRead = StdoutRead($iPid) If Not @error Then Local $add = 0 , $n = 1 , $sername , $dispname , $aStdoutRead , $tmp $aStdoutRead = StringSplit($StdoutRead,@CRLF,1) For $a = 1 To $aStdoutRead[0] $tmp = StringLeft($aStdoutRead[$a],1) If $tmp <> " " And $tmp <> "" Then $tmp = StringSplit($aStdoutRead[$a],": ",1) If $tmp[0] = 2 Then If $add = 0 Then ReDim $Output[$n+1][2] $Output[$n][0] = $tmp[$tmp[0]] $add = 1 Else $Output[$n][1] = $tmp[$tmp[0]] $Output[0][0] = $n $n += 1 $add = 0 EndIf EndIf EndIf Next If $Sort = 1 And $Output[0][0] > 0 Then _ArraySort($Output, 0, 1, 0, 1) ; Sort by DisplayName EndIf EndIf ;$Output[0][0] Return $Output EndFunc Edited May 3, 2014 by Guest Link to comment Share on other sites More sharing options...
Gianni Posted May 3, 2014 Share Posted May 3, 2014 Thanks for the information.Today I worked on it again.Please check if this code works for you: expandcollapse popup#include <Array.au3> $timer = TimerInit() $Services = _RetrieveRunningServices3() ConsoleWrite("Time: "&TimerDiff($timer)&@CRLF) _ArrayDisplay($Services) Func _RetrieveRunningServices3($Sort = 0) Local $Output[1][2] , $iPid $Output[0][0] = 0 $iPid = Run(@ComSpec & " /c sc query", @SystemDir, @SW_HIDE, 2) If $iPid > 0 Then ProcessWaitClose($iPid) Local $StdoutRead = StdoutRead($iPid) If Not @error Then Local $add = 0 , $n = 1 , $sername , $dispname , $aStdoutRead , $tmp $aStdoutRead = StringSplit($StdoutRead,@CRLF,1) For $a = 1 To $aStdoutRead[0] $tmp = StringLeft($aStdoutRead[$a],1) If $tmp <> " " And $tmp <> "" Then $tmp = StringSplit($aStdoutRead[$a],": ",1) If $tmp[0] = 2 Then If $add = 0 Then ReDim $Output[$n+1][2] $Output[$n][0] = $tmp[$tmp[0]] $add = 1 Else $Output[$n][1] = $tmp[$tmp[0]] $Output[0][0] = $n $n += 1 $add = 0 EndIf EndIf EndIf Next If $Sort = 1 And $Output[0][0] > 0 Then _ArraySort($Output, 0, 1, 0, 1) ; Sort by DisplayName EndIf EndIf ;$Output[0][0] Return $Output EndFunc it worked fine well done! bye Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... 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