When a java program executes, it creates a file in the directory that the program is located, I want the user to be able to dictate directory.Is it possible to do this? My intentions for the code are in the comments.Read the comments. This is not a duplicate because I also ask if changing the directory in the batch will change the directory that the java program executes in.
public static void main(String[] args) {
//open and run batch to navigate to desired directory
//conditional tests to see if in desired directory and then backs up using cd ..
//get input,batch file navigates to the directory that was entered
sozdatNovyFayl(getFileName());
//get name,create file,(self defined functions, already implemented)
}
Could somebody point me in the right direction on how to implement this. Is it possible to change the directory that application is working in from the one where it exists?