Hi, I need some help. I am trying to execute FTP.exe file with IP address from a java program using Runtime.getRuntime().exec("path\FTP.exe someIPaddress"); statement.But what happening is, ftp is starting but not able to stay within the same program. And also it is not asking for username and password also. Even if I give the username and password along with IP address, it is not accepting. So how do I execute this .exe file with/without options ? Thanks.
Well, you can do it this way by creating a file to use a a control file in which you write the open, setting the user and password, changing directories, putting files etc.(You can read the help associated withyour ftp program for the details) Then the command to ftp is ftp -s:filename You can pass this to runtime.exec() by creating a String array. That answers the question you ask but, a better approach is to use the UrlConnection class to connect to the ftp server and communicate with it directly inside your java program