[-AI-] 取得程序的命令列

楼主: GodIsland (搞不定吗用C4就对了)   2023-03-23 23:25:57
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)

Links booklink

Contact Us: admin [ a t ] ucptt.com