Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > How to call a java file through the prompt command


Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2003, 09:51 AM
fandecine fandecine is offline
Centurion
 
Join Date: Aug 2003
Posts: 107
Question Shell command question


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!

Last edited by fandecine; 08-29-2003 at 10:44 AM.
Reply With Quote
  #2  
Old 08-29-2003, 10:47 AM
fandecine fandecine is offline
Centurion
 
Join Date: Aug 2003
Posts: 107
Default

Quote:
Originally Posted by fandecine
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
Reply With Quote
  #3  
Old 08-29-2003, 11:07 AM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

What have you tried already?
Did you use ChDir to change directories to J:\dev\Course Magic first?
__________________
Posting Guidelines
Reply With Quote
  #4  
Old 08-29-2003, 11:21 AM
fandecine fandecine is offline
Centurion
 
Join Date: Aug 2003
Posts: 107
Default

Quote:
Originally Posted by Thinker
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!
Reply With Quote
  #5  
Old 09-02-2003, 02:08 PM
fandecine fandecine is offline
Centurion
 
Join Date: Aug 2003
Posts: 107
Default

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
Reply With Quote
  #6  
Old 09-02-2003, 03:32 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

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.
__________________
Posting Guidelines
Reply With Quote
  #7  
Old 09-02-2003, 03:39 PM
VBJoe's Avatar
VBJoe VBJoe is offline
Village VB Idiot

* Expert *
 
Join Date: Jan 2003
Location: Idaho
Posts: 1,850
Default

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:
Code:
'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"
Reply With Quote
  #8  
Old 09-04-2003, 11:03 AM
fandecine fandecine is offline
Centurion
 
Join Date: Aug 2003
Posts: 107
Default

Quote:
Originally Posted by VBJoe
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:
Code:
'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)

Last edited by fandecine; 09-04-2003 at 11:45 AM.
Reply With Quote
  #9  
Old 09-04-2003, 01:30 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

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
__________________
Posting Guidelines
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installation Problem - PLs help urgenlty dpdsouza Installation / Documentation 4 12-02-2004 07:09 PM
Exporting Outlook Contacts to Access worchyld Word, PowerPoint, Outlook, and Other Office Products 6 08-29-2003 09:38 AM
Algorithm Problems Arkasizer Game Programming 5 12-18-2002 07:37 AM
Saving as Random Access File VillageBaboon General 5 06-14-2001 10:25 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->