#include <WinAPIProc.au3>
Global $hToken, $aAdjust, $aProcList, $sScipt, $sStr
$sScipt = @ScriptDir & '\Script.au3' ; Проверяемый скрипт
$sStr = 'Скрипт: "' & $sScipt & '"' & @LF & 'Выполняет программа:' & @LF
$hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY))
_WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust)
$aProcList = ProcessList()
$sScipt = StringReplace($sScipt, '"', '')
For $i = 1 To $aProcList[0][0]
$sCommLine = StringReplace(_WinAPI_GetProcessCommandLine($aProcList[$i][1]), '"', '')
If Not StringCompare($sCommLine, $sScipt) Then _
$sStr &= ' - "' & _WinAPI_GetProcessFileName($aProcList[$i][1]) & '" (PID: ' & $aProcList[$i][1] & ')' & @LF
Next
_WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust)
If $hToken Then _WinAPI_CloseHandle($hToken)
MsgBox(262144, Default, $sStr)