How to call a java file through the prompt command

fandecine
08-29-2003, 09:51 AM
I want to call the command prompt, go to: J:\dev\Course Magic location and run: java CourseParser medium "N:\IS\DESIGNER\Copied Files\hs\WGHT 41\coursetext\WGHT41.htm" J:\dev\111111111111\test

How do I do it?
Shell("command.com...
Thanks a lot!

fandecine
08-29-2003, 10:47 AM
I want to call the command prompt, go to: J:\dev\Course Magic location and run: java CourseParser medium "N:\IS\DESIGNER\Copied Files\hs\WGHT 41\coursetext\WGHT41.htm" J:\dev\111111111111\test

How do I do it?
Shell("command.com...
Thanks a lot!

updated

Thinker
08-29-2003, 11:07 AM
What have you tried already?
Did you use ChDir to change directories to J:\dev\Course Magic first?

fandecine
08-29-2003, 11:21 AM
What have you tried already?
Did you use ChDir to change directories to J:\dev\Course Magic first?

No, I just don't know how to do it!

fandecine
09-02-2003, 02:08 PM
I posted this thread days ago but didn't get any answers. I am trying again. I really need help for this one! Thanks.
LD

Thinker
09-02-2003, 03:32 PM
I asked if you tried the ChDir function to change directories before you
did the shell. At the least you should type in ChDir, select it and press
the F1 key to see what help says about it. You need to post more
details about what you have tried. We can't begin to guess what you
need otherwise.

VBJoe
09-02-2003, 03:39 PM
Is the Java file an Applet? If so, just use the WebBrowser control and .Navigate to the HTML file. I ask because you're pointing to an HTM file.

If the Java file is NOT an applet, and isn't embedded in an HTML page, you need to use Command.com to call the Java interpreter/compiler (I think it's called javac.exe) with the Java file as the parameter.

I've used the first method, and it works great:

'Make sure you drop a Browser control called WebBrowser1 on the form:
WebBrowser1.Navigate "N:\IS\DESIGNER\Copied Files\hs\WGHT 41\coursetext\WGHT41.htm"

fandecine
09-04-2003, 11:03 AM
Is the Java file an Applet? If so, just use the WebBrowser control and .Navigate to the HTML file. I ask because you're pointing to an HTM file.

If the Java file is NOT an applet, and isn't embedded in an HTML page, you need to use Command.com to call the Java interpreter/compiler (I think it's called javac.exe) with the Java file as the parameter.

I've used the first method, and it works great:

'Make sure you drop a Browser control called WebBrowser1 on the form:
WebBrowser1.Navigate "N:\IS\DESIGNER\Copied Files\hs\WGHT 41\coursetext\WGHT41.htm"


No it is not an applet! This is what the java file will do:

Run the java file "CourseParser" from the location "J:\dev\Course Magic"

"medium", "N:\IS\DESIGNER\Copied Files\hs\WGHT 41" and "J:\dev\111111111111\test" are parameters for the java file(parser command, source, destination)

So I was thinking about the Shell command but could find nowhere how to use it with a java file.
Thinker, I tried:
ChDir ("J:\dev\Course Magic")
Shell ("command.com")
but it opens the command prompt on the C: drive !

I tried the following but how can I run the java file now?
ShellExecute(hwnd, "open", "command.com", "", "J:\dev\Course Magic", 1)

Thinker
09-04-2003, 01:30 PM
just shell the whole thing...
tmpCmd = "command.com /c Java CourseParser medium '"N:\IS\DESIGNER\Copied Files\hs\WGHT 41\coursetext\WGHT41.htm'" J:\dev\111111111111\test"
Shell tmpcmd

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum