#RequireAdmin
#include <WinAPIProc.au3>
#include <WinAPI.au3>
#include <StringConstants.au3>
Global $aAdjust
Func ImproveMainCaptions($aProcList)
$iProcessNumer = $aProcList[0][0]
For $i = 1 To $iProcessNumer
$ID = $aProcList[$i][1]
$sCmdLine = _WinAPI_GetProcessCommandLine($ID)
$str = "Err:" & @error & " Line:" & $sCmdLine
MsgBox($MB_SYSTEMMODAL, "Important1CParametersLine", $str)
; here @error is 40 and &str is empty string
; but only on one computer. All others are fine.
Next
EndFunc
; Main Entry point
$hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY))
_WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust)
If Not (@error Or @extended) Then
$aProcList = ProcessList("1cv8.exe")
ImproveMainCaptions($aProcList)
_WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust)
_WinAPI_CloseHandle($hToken)
EndIf
markyrocks, thank you for usefull info. I scented that it's a privilege issue.
Now, I moved #RequireAdmin to first line and run script again on that computer. Definetly As Administrator. But nothing changed Can I try something else?