aspose file tools*
The moose likes Beginning Java 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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
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
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

I'm not a Dos expert but in case it helps, this is a .bat file I use:
path=c:\jdk1.3\bin
cd..
cd JAVAJUNK
java IPaddress


SCJP
Visit my download page
Grant Crofton
Ranch Hand

Joined: Nov 08, 2000
Posts: 154
Do you have the paths set up right?
Type the command in the batch file into DOS by hand from the directory it's held in, and see if that works (in your case, 'java TransformFile1').
If it does, there's no reason it wouldn't work in the batch file. Are you sure it isn't working? If DOS couldn't find java.exe (the prog you are trying to run), it would come up with an error, and if java had a problem running your program, that would complain as well.
Perhaps the program just doesn't work right?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java program & Windows batch files
 
Similar Threads
java program that can run a .class file in msdos, is this possible?
Not able to run java
Running a Java Program from Command Prompt
java programs & Windows batch files
java program & Windows batch files