-1

All I want to create a desktop shortcut that do :

start cmd.exe 
D:
cd data-generator
java -cp bitcoin-data.jar com.dev.DoSomething

cmd should be running after that so that I can see console logs.

0

You could create a batch script which runs the commands you stated. To do this, open notepad (or any text editor) and write the commands, with each new line being a new command. Note that you do not need the "start cmd.exe line", and to keep the window open at the end, include a pause command. Example contents of your file:

D:
cd data-generator
java -cp bitcoin-data.jar com.dev.DoSomething
pause

Then, save the file as a .bat

NOTE That your text editor may try and save the file as a text (.txt) file, so make sure to select the type as "all files" and ensure that the .bat is at the end of the file as shown below.

Example notepad saveas window

Once you have saved the file, you can double click it to run the commands.

For a more advanced tutorial, check this out: Batch File Tutorial

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.