C
Cindy Parker
I have problems to pass a dragged filename as parameter to a shortcut to a program.
Lets make a sample for *.jar files but this is a problem for other extensions as well.
Ok I have a executable Java *.jar file e.g. myjava.jar. To run this archive I have to prepend the java
program. So at first I create a shortcut from this *.jar and enter the following command line in the
shortcuts properties:
java -jar D:\java\myjava.jar
Whenever I click now on this shortcut the java and jar prgm are executed successfully.
Fine.
Now I want to pass additionally a filename to the *.jar prgm.
So I changed the command mentioned above in the shortcut to
java -jar D:\java\myjava.jar "%1"
After that I dragged a file foobar.txt onto this shortcut and expected that the java jar
program would run with the filename as parameter:
java -jar D:\java\myjava.jar "D:\test\foobar.txt"
But it doesn't.
Ths filename is somehow not forwarded as parameter.
Whats wrong?
Cindy
Lets make a sample for *.jar files but this is a problem for other extensions as well.
Ok I have a executable Java *.jar file e.g. myjava.jar. To run this archive I have to prepend the java
program. So at first I create a shortcut from this *.jar and enter the following command line in the
shortcuts properties:
java -jar D:\java\myjava.jar
Whenever I click now on this shortcut the java and jar prgm are executed successfully.
Fine.
Now I want to pass additionally a filename to the *.jar prgm.
So I changed the command mentioned above in the shortcut to
java -jar D:\java\myjava.jar "%1"
After that I dragged a file foobar.txt onto this shortcut and expected that the java jar
program would run with the filename as parameter:
java -jar D:\java\myjava.jar "D:\test\foobar.txt"
But it doesn't.
Ths filename is somehow not forwarded as parameter.
Whats wrong?
Cindy