作者GodIsland (搞不定吗用C4就对了)
看板EzHotKey
标题[-AI-] 取得程序的命令列
时间Thu Mar 23 23:25:57 2023
How to Get the Command Line that a Running Process was Ran With? - AutoIt
General Help and Support - AutoIt Forums
https://www.autoitscript.com/forum/topic/164039-how-to-get-the-command-line-that-a-running-process-was-ran-with/
$PID = @AutoItPID ; just to pick a PID
$oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
If @error Then
RunWait(@ComSpec & ' /c net start winmgmt ', '', @SW_HIDE)
RunWait(@ComSpec & ' /c net continue winmgmt ', '', @SW_HIDE)
$oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
EndIf
$oProcesses = $oWMI.ExecQuery("SELECT * FROM Win32_Process", "WQL", 0x30)
For $oProcess In $oProcesses
If $oProcess.ProcessId = $PID Then ExitLoop
Next
MsgBox(262144, Default, $oProcess.CommandLine, 0)
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 220.132.89.223 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/EzHotKey/M.1679585161.A.031.html