Is it possible to create a new process on windows with a different user account? I know there are a context menu "Run as" but I want do it from Java. I have the username and the password.
You need to write a DLL using the Java Native Interface (JNI) as you cannot do this with pure Java code.
The DLL itself needs to call the CreateProcessAsUser function to create a process in the context of another user. To successfully create that process you need to provide an access token to the function, which was itself created by calling the LogonUser function (it takes the username and password to authentify that other user).