Directory Question
I am trying to run a system call from a specified directory and it doesn't seem to be working. The call itself just renames a Rational/IBM database replica called a VOB.
The command has to be run in this directory:
M:\SiteA_VIEW\SiteA_VOB
The actual command is something like:
multitool rename replica:SiteA SiteB
In the above SiteA is the original name of the replica and SiteB is what I want to change the name too.
I am using Java Swing and Netbeans 5.5.1 and the code is below.
privatevoid btn_RenameActionPerformed(java.awt.event.ActionEvent evt){
// TODO add your handling code here:
String VOBpath =null;
String CReplica =null;
String NReplica =null;
VOBpath = txt_VOBpath.getText();
CReplica = txt_Currentrepname.getText();
NReplica = txt_Newrepname.getText();
String command = (VOBpath +" cmd /c multitool rename replica:" + CReplica +" "+ NReplica);
StringBuffer sb =new StringBuffer();
Process p =null;
try{
p = Runtime.getRuntime().exec(command);
}catch (IOException ex){
ex.printStackTrace();
}
}
txt_VOBpath holds the path of the directory that the command needs to be run from
txt_Currentrepname holds the original name of the VOB
txt_Newrepname holds the new name of the VOB
When I run the debugger the String command is equal to:
M:\SiteA_VIEW\SiteA_VOB cmd /c multitool rename replica:SiteA SiteB
Anyone have any ideas as to what could be wrong?
Thanks

