1.

Solve : Execute a Command line entry from a batch file?

Answer» OKAY, firstly I am doing this to MAKE things go faster for my classwork with a program called OSP2 (remembering the command for it is the thing I'm trying to avoid).

I am PLANNING on having this in the program's directory, and the USER can enter two arguments, a sub directory and a specific jar file to use. The jar file I would like to default to demo.jar if none is entered.

Below is what I'm thinking so far from other guides on the site.

The actual command when in the prompt is:
Code: [Select]java -classpath .;demo.jar osp.OSPand is typed in the specific projects folder in the command prompt to get the desired result when using demo.jar.

I would like argument one to be the specific project name (the subfolder under projects to go into prior to executing the command) and the second argument to be the jar file name used in the command itself), if the second argument is not GIVEN, assume it is "demo."

I am using this on Windows XP Computers.

Code: [Select]cd projects/%1
if(%2) GOTO CUSTOM
java -classpath .;demo.jar osp.OSP
goto END
:CUSTOM
java -classpath .;%2.jar osp.OSP
:END


Discussion

No Comment Found