Hey guys, i am new to programing and i was wonder can java run, windows commands such as turning off a certain program or the whole comp itself at a certain time.
this is what i wanna do, say at 3 oclock i wanna shut off my comp, is there a way i can do this in java. Id appreicate you help, thanks again
09-28-2004, 07:06 PM
Drain
There are ways to do this, but it depends on the OS.
C:\windows\rundll.exe user.exe,exitwindows
I think that works in 9x; not sure if it works in XP.
You'd create a Timer/TimerTask, perhaps using gregorian calendars to check the current time, or just calculate out the duration and have it run once. Check out Runtime.exec()... it's what you'll need to use to run the actual command.