Program to shutdown computer after a certain time
Your questions at the end are the most important points here, so I answer those first:


  but will any of these operations harm my computer in any way?


No, and how could it anyway?


  Will it be better if I just learn to do this via powershell?


Yes! Writing a Java program for this is overkill!

In terms of a Java implementation, I think you're really overcomplicating it:


Why use a thread to do this? As you're not going to do anything else in parallel, it's pointless.
Why use a timer? Essentially the same argument applies here too as with threads: you're not doing anything else in parallel, so what's the point? And putting a timer inside a thread seems doubly pointless.


Maybe you assumed that by running this in a thread, the application will just schedule the task and exit. That is not the case. The JVM will continue running until the task is completed, and the program will stay in the foreground. You would have to background the process in the calling shell.

As such, you could replace this with a much simpler implementation:

public static void main(String[] args) throws InterruptedException, IOException {
    if (args.length &lt; 2) {
        System.out.println("usage: java PCShutdown HOURS MINUTES");
    }
    int hours = Integer.parseInt(args[0]);
    int minutes = Integer.parseInt(args[1]);
    Thread.sleep(hours * 60 * 60 * 1000 + minutes * 60 * 1000);
    Runtime.getRuntime().exec("shutdown -s -t 30");
}


But then, I'd return to my earlier statement: Java is overkill for this, use the shell and native scheduling features instead (for example at in UNIX).