Open your System Directory From Java


While running the following program you can easily open directory that you like from Java Code.
// Comment
package com.sabari;

import java.io.IOException;

public class opendirectory {
 public static void main(String[] args) throws IOException {
  String cmd = "cmd.exe /c start ";
  String file = "c:\\";
  Runtime.getRuntime().exec(cmd + file);
 }

}



Output Screen 

raja P Web Developer

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...