Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to execute......................  RSS feed

 
chandhana
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have a doubt,how to execute msdos commands from java application.
server & so many clients r there. Then for example how the server can restart the client system by using msdos commands.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chandhana,
Welcome to the Ranch! Our Naming Policy requires users to have both a first and last name. Please go to your profile and change your display name to follow our policy.
Thanks!
 
Murat Balkan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Runtime's exec function:
Runtime.getRuntime().exec("...");
Murat
 
srinivas daroori
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can call the
Process p = Runtime.getRuntime().exec(dosCommand)
which will start a new process to execute your dosCommand. And also wait for the process to complete before doing any thing else by calling the
p.waitFor() which makes the program to wait for the above process to be completed before going to the next step.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!