Click here to Skip to main content
15,886,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,


i am new to java and need your help, i am developing a java code that will go to a directory and execute a command their. I will make it simple to you suppose i am having directory I in my system i want to go to directory I and perform a command line operation, i googled this and found out that we can achieve this by using process builder class, please help me with the java code that will go to Directory I/J/K and perfom commands.


I am sorry if you are not able to get me , I am totally confused at this moment please reply me if you have any doubts.
Posted

1 solution

I am not sure that you can change the current directory in Java. However, you should use the Java Runtime[^] class to execute your commands.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900