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 switc
In Linux we have su
for this,
I am not sure about windows but this blog seems doing it.
further
here is code snippet to execute native commands from java
try {
// Execute a command without arguments
String command = "dir";
Process child = Runtime.getRuntime().exec(command);
// Execute a command with an argument
command = "dir";
child = Runtime.getRuntime().exec(command);
} catch (IOException e) {
}
Source