_RaiseToSystem()
Func _RaiseToSystem()
Local $sApp, $sArg, $hToken, $pUserThread, $pUserLogged
$pUserLogged = _LookupAccountName(_LsaGetUserName(False))
$hToken = _OpenProcessToken(-1)
$pUserThread = _LookupAccountName(_GetTokenUser($hToken))
_LsaCloseHandle($hToken)
If _EqualSid($pUserLogged, $pUserThread) Then
If @Compiled Then
$sApp = @ScriptFullPath
$sArg = " " & $CmdLineRaw
Else
$sApp = @AutoItExe
$sArg = " " & FileGetShortName(@ScriptFullPath) & " " & $CmdLineRaw
EndIf
$ID=_CreateProcessAsSystem($sApp, $sArg, "Winlogon.exe")
Exit(_HeapFree($pUserLogged) or _HeapFree($pUserThread))
EndIf
Return _HeapFree($pUserLogged) or _HeapFree($pUserThread)
EndFunc ;==>_RaiseToSystem
这段代码好像在User用户下运行没有效果啊。要Administrators权限才可以运行。 |