Windows permissions check in Java
A program I develop for Windows changes the registry sometimes. It only works when run as administrator. It indicates that there's no permission to update the registry only when the update fails. There is a little problem with that: when the update fails, it shows a message and all, but also Windows shows a message that says "The program wasn't run correctly" something like that.
What I'm thinking is, can I do a simple check if I have the rights to update the registry without trying to do it? Or, for example, check if I'm administrator or have admin rights?
Thnx
Windows permissions check in Java
===

A program I develop for Windows changes the registry sometimes. It only works when run as administrator. It indicates that there's no permission to update the registry only when the update fails. There is a little problem with that: when the update fails, it shows a message and all, but also Windows shows a message that says "The program wasn't run correctly" something like that.
What I'm thinking is, can I do a simple check if I have the rights to update the registry without trying to do it? Or, for example, check if I'm administrator or have admin rights?
Thnx