Search code examples
javawindowsjcmd

JCMD for different user


I need to grab parameters from jcmd for process, which started by other user on same PC. But I can't do it using admin account. I also tried to use 'runas' function, but have same result. Is there a way to catch this process, except using the same user? enter image description here

enter image description here


Solution

  • have the answer. Java locates it perf files in user temp folder, besides, it cleaning stopped process files on each jcmd request. That's why you can't get perf.counter data from other user, also you cant use perf file of other user under your account. Another trouble is that if you want to use windows task scheduller for that purposes, you MUST run this task ONLY, when user is logged. Other way you will have permission exception.