Creating batch file

By amu
Aug 1, 2009
  1. Hello!

    I have created a java application. and I want to give it to my friend who does not have java installed on his machine.So I want to give him java setup and only a jar file of my application.
    For that I created batch file as follows:

    set path=d:\Test 3\jdk1.6.0_14\bin;%PATH%

    SET CLASSPATH=.;d:\jdk1.6.0_14\jre\lib\rt.jar

    java -jar "Test3.jar"

    Now if my friend puts this Test 3 folder on D drive,then only the application executes.This is obvious I knw.
    But there is possibility that someone may or may not have D drive. In this case, what I want to do is, when he copies the folder and paste it anywhere,and just double clicks on the batch file the application should execute.
    So is there any method in batch file to get the path of the folder where he has pasted that folder?

    Please help me...
Topic Status:
Not open for further replies.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...