Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create shortcut for my command which run My project from my "F" drive.
command is as below

java -jar "F:\I m user\Last year fun\project\model wise\new\something\dist\something.jar"

For this I need to set path in Command prompt as
C:\Program Files\Java\jdk1.7.0\bin>
and then to execute above first command.

Is there any way to run and execute or do this two task with one shortcut icon?
please suggest me the best way to do this


Vishal Kolekar
Posted

I googled the phrase "c# create desktop shortcut", and got back 3.3 MILLION results, among them:

http://www.geekpedia.com/tutorial125_Create-shortcuts-with-a-.NET-application.html[^]

Google reveals all.
 
Share this answer
 
Comments
Vishal D Kolekar 22-Apr-11 12:39pm    
I got solution
create shortcut from bin folder for "java"
then specify path for target....as my first command....
Sorry John I didn't get anything from your link
But thank you very much John for your quick response
see you buddy with my next question....
bye..
Sergey Alexandrovich Kryukov 22-Apr-11 23:00pm    
That is correct, my 5, but...
I offer 2 (two) convenient alternatives, please see.
--SA
Another approach: create a file, name if, say "javasomething.bat" and place your command line in it — will work immediately.

You can use a file as a parameter; to do that, write in a bath file:

java -jar "%1"


Yet another options. Forget this stupid (read my lips: "stupid") Explorer!
Use one or another so called Orthodox file managers, see http://en.wikipedia.org/wiki/Orthodox_file_manager#Orthodox_file_managers[^]. Most of them implement standard Shell API as Explorer does but work nicely with command line (Explorer is very unfriendly to command line) and provide convenient tools to remember, bookmark and execute commands. I use TotalCommander (http://en.wikipedia.org/wiki/Total_Commander[^], http://www.ghisler.com/[^], shareware).

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900