1

Is it possible to create something like a desktop shortcut that I could double click to run a particular command that I would normally type out in command prompt? Here is one that I want to make a shortcut of:

C:\Users\jdave\Documents\Java>appletviewer ButtonExample.html

I asked this on Yahoo Answers because I thought it would be a little basic for Stack Overflow and one person said to create a batch file like so:

@echo off
start "C:\Users\jdave\Documents\Java>appletviewer ButtonExample.html"

I did this but all it does is open a command prompt window.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Jvalant Dave
  • 17
  • 1
  • 6

5 Answers5

2

Your batch file should look something like this:

@echo off
cd C:\Windows\System32\
start notepad.exe C:\Users\"user1"\test.txt

Replace the "user1" with your username or give the proper path to your application.

Make sure that appletviewer takes the type of parameter that you are passing it.

dmcgill50
  • 528
  • 6
  • 26
1

You can just create a shortcut with

C:\Users\jdave\Documents\Java\appletviewer ButtonExample.html
Joey
  • 344,408
  • 85
  • 689
  • 683
0

Your command doesn't look correct, try this:

C:\Users\jdave\Documents\Java\appletviewer GifExample.html

Ensure that appletviewer.exe exists in this location.

Reimeus
  • 158,255
  • 15
  • 216
  • 276
  • `start` is a built-in command of `cmd`, not a program. So you need to run it through `cmd`. But you don't need it at all here. – Joey Oct 25 '12 at 18:32
0

You need to set java bin directory in environment variable path. Use following batch :

@echo off
cd  "C:\Users\jdave\Documents\Java"
appletviewer GifExample.html
Nandkumar Tekale
  • 16,024
  • 8
  • 58
  • 85
0

Right-click on Desktop > New > Shortcut. Enter Location

appletviewer GifExample.html

Click Next, enter name of shortcut, click Finish. You're done.

By the way, the > you see on the command prompt is not part of the command. The actual command starts after the > symbol.

Also, the 'appletviewer' program probably doesn't reside in C:\Users\jdave\Documents\Java. The above is correct if you can already run appletviewer from any folder in the command prompt. If you do C:\Users\jdave\Documents\Java\appletviewer GifExample.html it may not work at all!

ADTC
  • 8,999
  • 5
  • 68
  • 93