aspose file tools*
The moose likes Java in General and the fly likes java program & Windows batch files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java program & Windows batch files" Watch "java program & Windows batch files" New topic
Author

java program & Windows batch files

Renu, Vairagade
Greenhorn

Joined: Feb 02, 2001
Posts: 21
Hello,
I want to write a Window .bat file (batch file) that executes a java program. I've written one batch file(see below), but it does not execute java program. What's wrong?
reporting.bat
---------------------------------------------------
copy C:\Report_Input.TXT C:\back_up_reports
java TransformFile1
copy Output_file.TXT C:\back_up_reports

------------------
V Renu


V Renu
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Run your bat from the DOS command prompt, and look at what exactly the error message says. If you can't figure it out, then report the message here. As a guess though, check your system variables. Does PATH include the directory for the java.exe file? Does CLASSPATH include the directory that has Transform1File.class? Backing up - does Transform1File.class even exist?


"I'm not back." - Bill Harding, Twister
Renu, Vairagade
Greenhorn

Joined: Feb 02, 2001
Posts: 21
My batch file works finely, when executed from command line, executes the java program properly, gives no error message. But that's doesn't solve my problem. Actually, I am using an application called WebTrends log Analyzer(webtrends.com), which generates certain statical reports on websites. It gives one option called Post-processing, which allows to excute a specified .exe or .bat file just after report-generation. I am using it & want the java program TransformFile1 to be executed through the .bat file. But that doesn't happen with WebTrends Log Analyzer.
------------------
V Renu
Renu, Vairagade
Greenhorn

Joined: Feb 02, 2001
Posts: 21
Thank you very much! You gave me clue to solve my problem. Actually I am using an application which allowes to run .bat files as Post-processing after a specific action. It required the CLASSPATH setting of system to modified to include the directory containin file Transform1.class. I was setting the classpath manually in only one session, when I was executing the .bat file from command line where it worked fine. But it didn't work when the application fired the execution of .bat, becoz CLASSPATH was not set. Now I changed the settings & my application is working fine. Than you again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java program & Windows batch files