Command Prompt and Visual Basic

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2004
Posts: 46
Reputation: tom_h_500 is an unknown quantity at this point 
Solved Threads: 0
tom_h_500's Avatar
tom_h_500 tom_h_500 is offline Offline
Light Poster

Command Prompt and Visual Basic

 
0
  #1
Sep 21st, 2005
I was wondering if it was possible for me to write a simple program that either lets you use command prompt with visual basic (i.e. press a button and it does a command in CMD) if it can't be done in VB is there any other programming languages that allow me to do this. Thanks.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 104
Reputation: Alvein is an unknown quantity at this point 
Solved Threads: 4
Alvein's Avatar
Alvein Alvein is offline Offline
Junior Poster

Re: Command Prompt and Visual Basic

 
0
  #2
Sep 21st, 2005
Quite possible by using ShellExecute with lpFile="cmd.exe" and lpParameters="/c <your command here>" (can be also "/k", just read the cmd.exe help).
Last edited by Alvein; Sep 21st, 2005 at 7:55 pm. Reason: doh
Damn it, I still dream of her....:(
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 121
Reputation: jwshepherd is an unknown quantity at this point 
Solved Threads: 5
jwshepherd's Avatar
jwshepherd jwshepherd is offline Offline
Junior Poster

Re: Command Prompt and Visual Basic

 
0
  #3
Sep 22nd, 2005
shell "cmd.exe /c"

will get you to the comamnd prompt. Shellexecute will give you more options and handling and return values, but if you just need the prompt, there you go.
.: We may acquire liberty, but it is never recovered if it is lost :.
irc://irc.rizon.net/#itf
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC