imnebula 发表于 2011-1-24 00:55:13

如何获取任意或特定的一个启动项程序的具体位置?

开机启动里,有哪些程序,我怎么获取这个列表。
比如c:\dd\dd.exe   
这样具体的地址 而不是加了参数啊之类 的地址。我只想找到这个程序而已。

然后怎么提取任意一个,或特定的一个地址?

请兄弟姐妹们指教~~~

netegg 发表于 2011-1-24 09:15:06

读注册表,然后拆一下字符串

smartzbs 发表于 2011-1-24 09:19:43

获取开机启动项:
http://www.autoitx.com/forum.php?mod=viewthread&tid=13501&highlight=%C6%F4%B6%AF%CF%EE

获得进程运行路径:
#include <WinAPI.au3>
$Process = "lsass.exe"
$FullPath = _GetProcPath($Process)
If Not @error Then MsgBox(0, "Process Full Path", "Process = " & $Process & "Path = " & $FullPath)

Func _GetProcPath($Process_In)
    Local $iProc, $hModule, $hProc, $stString, $iResult, $sPath

    $iProc = ProcessExists($Process)
        If Not $iProc Then Return SetError(1, 0, "")
    $hModule = 0
    $hProc = _WinAPI_OpenProcess(BitOR(0x0400, 0x0010), False, $iProc)
    $stString = DllStructCreate("char")
    $iResult = DllCall("Psapi.dll", "dword", "GetModuleFileNameEx", _
      "hwnd", $hProc, _
      "hwnd", $hModule, _
      "ptr", DllStructGetPtr($stString), _
      "dword", 260)
   
    $sPath = DllStructGetData($stString, 1)
    Return $sPath
EndFunc
页: [1]
查看完整版本: 如何获取任意或特定的一个启动项程序的具体位置?