I'm trying to create a java program that completes a DOS command which include an XML file. I am able to get it to execute the dos command fine, but I'm having some trouble with the XML file. The DOS command uses the netsh included in vista/win7. For the command to execute correctly, you have to specify the path of the XML file. I don't want the program to have to be distributed with the XML file. So..
I need some direction on how to either:
1. Have the code create the XML file every time it runs
2. Have it extract the XML file from the jar every time it runs.
Concerning #1: I already have the XML file, so I don't need Java to create the code and then the file. Only generate the file from code I can already provide.
Concerning #2: I know there is a dos command to extract a file from a jar, but I was wondering if there is an java code to do this instead.
So, you have that XML file inside a JAR, and you need to write it to the file system as a separate file? Java has an API for working with JAR files, have a look at the documentation of the package java.util.jar.