Guest ksbrace Posted September 27, 2002 Posted September 27, 2002 Hello, I am currently trying to make a program to grade my students java program. I want to be able to send command line commands such as 'javac' and 'java' to the Dos console via VB. I have tried using the Shell command and the API calls of ShellExecute and ShellExecuteEx, but, to no avail. Are there any other api calls that I can use to do this. I have a .bat file that simulates what I want to do, but it is UGLY and it doesn't do all that I would like it to do. Thanks in advance!!! Kelly Quote
*Experts* Bucky Posted September 27, 2002 *Experts* Posted September 27, 2002 According to AllAPI, the .NET equivalent for [api]ShellExecute[/api] is: System.Diagnostics.Process.Start("path goes here") It works for URL's, too, just like ShellExecute. If you want to shorten it, add Imports System.Diagnostics at the top of your code, then all you need to type is Process.Start (if you didn't know that already). HTH Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Guest ksbrace Posted September 27, 2002 Posted September 27, 2002 Thanks for your response. I understand that, I'm trying to send commands to the DOS window. Such as 'java' & 'javac' to compile and run students java programs. Maybe I'm doing it wrong, but I think I have it correctly. When I put in a URL or a txt file the correct app opens them. But I want to control Dos from VB. Thanks in advance Quote
*Gurus* divil Posted September 27, 2002 *Gurus* Posted September 27, 2002 It's not a DOS window, it's a 32bit Windows console window. As for your question, one of the overloads of Process.Start accepts a parameter of type ProcessStartInfo. One of the members of this type is RedirectStandardInput. Investigate this and you should be well on your way. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
srivalli Posted November 6, 2003 Posted November 6, 2003 Urgent Help with DOS Command - Net View Thanks for the help! Can you tell me how to Run the DOS Command, Net View(which gives the Network Status) using ProcessStartInfo in VB .Net. My Problem is that it asks for a Filename for the Command which i'm unable to locate. Thanks in Advance for your Help Srivalli Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.