java - Change content of batch file -


how change content of batch file using java code?

i worked parsing xml using java program. worked fine. can same batch file using java?

i able run batch file using below code.

string command = "cmd /c start " + batfile; runtime rt = runtime.getruntime(); rt.exec(command); 

the content of batch file is:

@echo off cd c:\program files (x86)\sourcemonitor start sourcemonitor.exe /c "c:\shravani-workspace\appanalytix\src\main\resources\appanalysis.xml" exit 

but before doing want change location

c:\shravani-workspace\appanalytix\src\main\resources\appanalysis.xml 

..to user given xml location. how can achieve in java application?

how passing command line args bat file so:

@echo off cd c:\program files (x86)\sourcemonitor start sourcemonitor.exe /c %1 exit 

then modify java code pass in xml file name after bat file name


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -