Detect if Java application was run as a Windows admin

前端 未结 8 2135
天命终不由人
天命终不由人 2020-11-27 05:37

I have a Java application. Is there anyway I can tell if the process was run with admin privileges, on Windows 7.

8条回答
  •  我在风中等你
    2020-11-27 06:01

    There is not such a facility available in the Java Runtime Environment, but might be in a platform-dependent native routine. Note that usually the best way to be certain is to actually try to do it, and see if it fails.

提交回复
热议问题