问题描述:

I have a vbscript that my Windows-only application uses. I call it using Runtime exec

wscript my_script.vbs

And it works.

Now I want to distribute the application as a jar. Where should I put the script?

网友答案:

You might want to think of a folder called resources or scripts that would be at the same level as your src or bin folders.

网友答案:

Include the file in your JAR. The first time you need it, copy it from the JAR:

this.getClass().getResourceAsStream("my_script.vbs");

And store it in the Application Data directory:

File file = new File(System.getProperty("user.home") + "/Application Data/MyApp/my_script.vbs");

Run it as needed from there.

相关阅读:
Top