문제

I need to attribute a password to my system account (UTILISATEUR-PC/UTILISATEUR° using java code. Is there any java api or indication how to start to make this work?

도움이 되었습니까?

해결책

There is no standard Java API to do this.

You could identify an (operating system specific!!) external command to do this, and then invoke that command using Runtime.exec(...) or equivalent.

However, I think you are better off doing this directly; e.g. by running commands from the command line by hand.

Tinkering around with system account passwords in a program:

  • requires elevated privilege, and programs that can elevate their privilege are a bad idea,

  • is potentially dangerous, since if the program messed it could effectively disable the account. (Exactly how dangerous that is depends on the importance of the account, and whether there are easy ways to undo the damage.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top