You don't make it clear whether you are trying to do this from a
Java program or from the command line.
If from a Java program, there are no pure Java solutions to this. You would need to use either native Windows code (JNI) or to run an external native program via Runtime.exec().
If you just want to do it from the command line, go look at Sysinternals' tools.