-3

Possible Duplicate:
Detect if Java application was run as an admin

How do I find out if the user running my Java application is a Windows administrator, or not?

Community
  • 1
  • 1
RTA
  • 1,251
  • 2
  • 14
  • 33
  • Actualy my application is eclipse plug-in thats why i tagged yes, i agree this is a stand alone question so if it may needed i will discard it. – RTA May 03 '12 at 04:48

1 Answers1

4

Java is cross platform and there is no way to see directly whether the user is a Windows administrator. In general you should check for the priviledges you need instead of relying on some knowledge about what it means to be an administrator on Windows. For example, if you need to write to a file, check directly that the file is writeable etc...

Mathias Schwarz
  • 7,099
  • 23
  • 28
  • If you want to go with a hacky Windows-only, Oracle JVM-only solution then have a look at: http://stackoverflow.com/questions/4350356/detect-if-java-application-was-run-as-an-admin – Mathias Schwarz May 01 '12 at 07:13