1

I need to develop a java program that is able to eliminate user session from a windows server. For that I am using the java commands: Runtime.getRuntime (). Exec ("reset session").

When I run on my windows user, it works perfectly because my user is adm, but I would like any user to be able to run my program without these being adm, is there any configuration in the code that allows this?

  • I think the comand can only be run as admin? have a look at this post, maybe it helps: https://stackoverflow.com/questions/14596599/run-command-prompt-as-administrator – Jarlik Stepsto Feb 12 '21 at 14:12
  • Do you want to have a UAC prompt or do you want to bypass it? – dan1st Feb 12 '21 at 14:20
  • 1
    The you need to develop a servive that runs in background and has admin permissions. It provides an API where regular user applications can call this exact one function. But I would not recommend to develop a Windows service using Java. Better use C#/.Net and use named pipes for communication with the service (because named pipes carry the windows authentication information so that you can restrict access to certain user (groups). – Robert Feb 12 '21 at 15:34

0 Answers0