I want to create a method which does the following:
Creates a batch file in the current directory.
Runs the batch file (shut down hook) when the JAR is closed.
The batch file will delete the JAR file.
My problem is that I don't know how to create a batch File in Java and make sure that it deletes the current JAR file (no matter what the JAR file is renamed to).
Research:
Creating a ".bat" file, run it and delete it from Java https://coderanch.com/t/475303/java/create-execute-batch-file-java http://www.dreamincode.net/forums/topic/74058-how-to-create-batch-file-for-java-project/
I would imagine you would create the batch file, write to it and get the current JAR name and put the code for deleting it in the file - though I don't know what writing "IT" actually is.. What is the "syntax" for batch files? I'm sorry for such a stupid question.
Thank you.