問題描述
對于給定的 Windows 進程,我想知道它是用什么命令行參數(shù)啟動的.例如,Windows 任務(wù)管理器能夠顯示這一點.
for a given windows process I want to know with what command line parameters it was started. The windows task manager is able to show that for example.
先謝謝你!
推薦答案
假設(shè)您知道進程 ID,請使用 OpenProcess 來處理它(這需要提升權(quán)限,如文檔中所述).然后使用 NtQueryInformationProcess 獲取詳細的進程信息.使用 ProcessBasicInformation
選項獲取 PEB 進程 - 這包含另一個結(jié)構(gòu)指針,通過它你可以得到命令行.
Assuming you know the process ID, use OpenProcess to get a handle to it (this requires elevated privilege as noted in the docs). Then use NtQueryInformationProcess to get detailed process info. Use the ProcessBasicInformation
option to get the PEB of the process - this contains another structure pointer, through which you canget the command line.
這篇關(guān)于如何查詢正在運行的進程的參數(shù)列表?(窗口,C++)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!