wmic 进程空的可执行路径 [英] wmic process empty executablepath
本文介绍了wmic 进程空的可执行路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么来自 wmic process get name, commandline, processid, executablePath
的某些进程不显示 ExecutablePath
的值?
Why do some processes from wmic process get name, commandline, processid, executablePath
not display a value for ExecutablePath
?
但我可以在 taskmanager 中找到它?
But I can find it in taskmanager?
有没有办法从wmic一个>?
推荐答案
谢谢大家,特别是@Eryk Sun,这是我为其他人提供的非常简单的解决方案.
Thank you all, especially to @Eryk Sun, here is my quite simple solution for others who will contend with same problem.
import com.sun.jna.platform;
String getExPath(int pid) {
Kernel32 kernel32 = Kernel32.INSTANCE;
WinNT.HANDLE hProcess = kernel32.OpenProcess(WinNT.PROCESS_QUERY_LIMITED_INFORMATION, false, pid);
char buffer[] = new char[1024];
IntByReference size = new IntByReference(buffer.length);
kernel32.QueryFullProcessImageName(hProcess, 0, buffer, size);
return new String(buffer).trim();
}
我正在寻找类似的方法来获取进程的命令行,但我没有成功.感谢您的建议.
I was looking for similar method for obtain a commandline of process but i was not sucessfull. I appreciate an advice.
这篇关于wmic 进程空的可执行路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文