Skip to main content
Participant
May 19, 2007
Answered

Execute bat file with cfexecute

  • May 19, 2007
  • 1 reply
  • 1204 views
Hello,
this is a newbie question but I'm stuck. I have a .bat that runs fine through the command prompt but won't run with <cfexecute>, it merely seems to read the .bat but not execute it. The .bat reads:

java -classpath ".;C:\CFusionMX7\wwwroot\i-recall\javaClasses\GATE-3.1\bin\gate.jar" AnnieAPI

When I run <cfexecute name="C:\CFusionMX7\wwwroot\i-recall\javaClasses\GateClasspathRun.bat" variable="myVar" timeout="100">
</cfexecute>

The output looks like this:
C:\CFusionMX7\runtime\bin>java -classpath "C:\CFusionMX7\wwwroot\i-recall\javaClasses\GATE-3.1\bin\gate.jar" AnnieAPI

It simply reads it and doesn't execute the java AnnieAPI command. I didn't write this .bat file so maybe I need to add something to make it run. Any help is appreciated.

-Kalen G
This topic has been closed for replies.
Correct answer Kalen_G_
What about this one?


edit: By the way, what is the full path of the file AnnieAPI.class?



I figured it out. Even though the bat file and the java class are in the same folder, I had to specify the location by adding the following lines to beginning of the bat file:

cd/
cd cfusionmx7/wwwroot/i-recall/javaClasses

Now it works perfectly. Thanks for everyone's help, I appreciate it.
- Kalen

1 reply

Inspiring
May 20, 2007
Use the outputfile attribute of cfexecute to see what happened. Then read that file.
Kalen_G_Author
Participant
May 20, 2007
The output file reads the same as what's above:
C:\CFusionMX7\runtime\bin>java -classpath "C:\CFusionMX7\wwwroot\i-recall\javaClasses\GATE-3.1\bin\gate.jar" AnnieAPI

Any other suggestions?

Thanks
Kalen_G_AuthorCorrect answer
Participant
May 21, 2007
What about this one?


edit: By the way, what is the full path of the file AnnieAPI.class?



I figured it out. Even though the bat file and the java class are in the same folder, I had to specify the location by adding the following lines to beginning of the bat file:

cd/
cd cfusionmx7/wwwroot/i-recall/javaClasses

Now it works perfectly. Thanks for everyone's help, I appreciate it.
- Kalen