Simple Task?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Simple Task?

  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Simple Task?

    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

  2. #2
    Join Date
    May 2004
    Posts
    219
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center