Is it possible to set a different windows user with Java? I have following issue: My application executes written program as admin. However, at one point I need to switch windows user in order to execute program from the command line (this program can only be accessed by this user - I cannot start it as admin due to its license). So to simplify explanation i need to do following things: start program as admin login at one point as different user execute program from command line logout from user, login as admin continue to execute program till the end I did everything except logged in as user.