Trouble running a .CMD script from Java.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paul_Blaszka
Posted On:   Friday, March 15, 2002 11:08 AM

I'm attempting to run a .CMD file from java and then wait on the process to complete. The problem I'm having is that when exec(String[] cmd) is executed the cmd window is opened but the parameters never seem to be passed. example of the code looks like the following: String[] BuildCmd ={"c:\winnt\system32\cmd.exe","/y",CmdParm.GetBatchPath() aa, CmdParm.GetCmdPath(), CmdParm.GetExpressBatchPath(),CmdParm.GetRdcPath(), CmdParm.GetUserName(),cmdParm.GetPassWord(), CmdParm.GetInstanceName()}; try { PID = Runtime.getRuntime().exec(BuildCmd); catch(Exception ex){ // print error to log file ... }    More>>

I'm attempting to run a .CMD file from java and then wait on the process to complete. The problem I'm having is that when exec(String[] cmd) is executed the cmd window is opened but the parameters never seem to be passed.


example of the code looks like the following:


			
String[] BuildCmd ={"c:\winnt\system32\cmd.exe","/y",CmdParm.GetBatchPath()
aa, CmdParm.GetCmdPath(), CmdParm.GetExpressBatchPath(),CmdParm.GetRdcPath(),
CmdParm.GetUserName(),cmdParm.GetPassWord(), CmdParm.GetInstanceName()};

try {
PID = Runtime.getRuntime().exec(BuildCmd);
catch(Exception ex){
// print error to log file
...
}

   <<Less
About | Sitemap | Contact