• Post Reply Bookmark Topic Watch Topic
  • New Topic

access windows roles  RSS feed

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi. i would like to ask which classes are needed in order to gain access to windows access rights?

i want to know if the user logged in to the pc has admin rights or not. please advise
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay friend...

if i recall your topic it was gaining access about the user privileges
here in windows environment not UNIX and nor LINUX.

some privileges properties are stored inside the registry.
Trust me or not, there is.
Because, I remembered previously, to disable TaskManager, the property of that inside
Registry.

So, for your case.
today, i just thinking that what you need to do is
having A java app which could read and write to the windows registry.

Which location of the registry?
Find out on google and post it back here. I'm sure they have for it.
Then, using The common API for Windows Registry, here we have many in Java API of course.
So you don't need to hassle around by executing the Runtime.exec to run REG command as you are running the
registry app. Instead you talk with the API!
do adding the registry using the API, do removing, changing and so on using the Java API provided there.
I used JNIREG before

here

more simpler.

correct me if i'm wrong.
and please to anyone,
please respond with an alternative of this.
 
mark goking
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found an easier solution , using an existing class found in rt.jar. it is sun's implementation of jaas

you can find the solution here

http://tech.chitgoks.com/2010/10/21/detect-if-windows-user-has-admin-rights-using-java/
 
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that your code may now break when a new Java update or version is released. Classes in packages starting with com.sun, sun and sunw should be avoided. They are for internal use, and can be modified or removed at any time. That's why they are not in the public API.
 
mark goking
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for that tip rob!
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!