Results 1 to 2 of 2
Thread: Batch Executing
- 04-22-2009, 04:14 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 1
- Rep Power
- 0
Batch Executing
hi i have written this code to execute a batch file in windows 2003 server R2
but it does not execute anything. it opens the cmd.exe window and does nothing also
the "Exit Value" and "Return Code" is 0.
can anyone help me about this?
is there any windows registry setting to restrict the execution of batch files programatically?
Thank you!!!!
Java Code:try { Runtime runtime = Runtime.getRuntime(); Process process = null; try { System.out.println( "Running: " + fName + ".bat " ); process = runtime.exec( "cmd /c start " + fName + ".bat" ); int returnCode = process.waitFor(); System.out.println("Exit value " + process.exitValue()); System.out.println("Return code value " + returnCode); System.out.println("Finished running the SQL Loader script's process. " + " Exit Value = " + ( returnCode == 0? "Success" : "Failure" ) ); } catch ( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } catch ( Exception e ) { System.out.println( "Error running the sqlldr script: " + e ); e.printStackTrace(); }
- 04-22-2009, 04:17 PM #2
Similar Threads
-
Batch Files in java
By coco in forum New To JavaReplies: 3Last Post: 12-05-2008, 01:30 PM -
eclipse batch file
By doug99 in forum EclipseReplies: 6Last Post: 04-24-2008, 02:59 PM -
Problem in batch file
By marwa in forum New To JavaReplies: 0Last Post: 08-14-2007, 10:24 AM -
Executing Batch
By zcoarens in forum New To JavaReplies: 0Last Post: 08-14-2007, 09:49 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks