Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q4078 In C, I can use the system function to execute DOS-like commands e.g system("dir"); is there an equivalent in Java?

irt.org | Knowledge Base | Java | Q4078 [ previous next ]

Q4078 In C, I can use the system function to execute DOS-like commands e.g system("dir"); is there an equivalent in Java?

Please check out the "java.lang.Runtime" package. There you have methods like:

Runtime r = Runtime.getRuntime();
r.exec("c:\\yourfolder\\your.exe");

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.