Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Running an EXE...


Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2004, 11:48 AM
jeremyyak's Avatar
jeremyyak jeremyyak is offline
Regular
 
Join Date: Aug 2003
Location: Florida
Posts: 83
Question Running an EXE...


I want my program so when i push a button i runs lets say C:\test.exe.
So when i push the button the application goes like normal. I DO NOT want to run using my application i just want it to run.
Reply With Quote
  #2  
Old 08-08-2004, 12:03 PM
charlie's Avatar
charlie charlie is offline
Senior Contributor
 
Join Date: Jul 2003
Location: Barcelona (SPAIN)
Posts: 1,054
Default

Use Shell function for executing another programs.
What do you mean with "I DO NOT want to run using my application i just want it to run"??
__________________
01000011011010000110000101110010011011000110100101100101
~ En mi vida sólo hay dos días que no me importan: ayer y mañana ~
Reply With Quote
  #3  
Old 08-08-2004, 01:44 PM
MikeJ's Avatar
MikeJ MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,742
Default

I think he means it should run standalone... The Shell function will do that just like charlie said - as long as you send the second parameter with vbNormalFocus. (Or you could go fancy and use ShellExecute)
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #4  
Old 08-09-2004, 05:10 PM
jeremyyak's Avatar
jeremyyak jeremyyak is offline
Regular
 
Join Date: Aug 2003
Location: Florida
Posts: 83
Unhappy shell thing

I used that shell execute thing and it didn't work. I know i wrote the correc location of the file, but it still doesn't work...any ideas :/
Reply With Quote
  #5  
Old 08-09-2004, 08:51 PM
MikeJ's Avatar
MikeJ MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,742
Default

Define doesn't work. Also, can you show us what code you have? Again, Shell will work fine, ShellExecute is just to be fancy.
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #6  
Old 08-09-2004, 09:53 PM
Rashka's Avatar
Rashka Rashka is offline
Contributor
 
Join Date: May 2004
Location: Ohio, USA
Posts: 771
Default

lol...Mike you love that ShellExecute, everytime I say Shell you come back with ShellExecute!
Well, this time, it's my turn
Code:
Private Sub Command1_Click() Shell "C:\Program.exe", vbNormalFocus End Sub
This will open the form, and bring it to the frnt.
KISS = Keep It Short and Simple
For some people Mike, you have to kiss
__________________
Brandon

Once you embrace the idea that your customers deserve to die...
...it frees your mind to invent splendidly profitable products - Dogbert
Reply With Quote
  #7  
Old 08-09-2004, 09:57 PM
rajeeshun rajeeshun is offline
Senior Contributor
 
Join Date: Oct 2002
Location: Dubai & Srilanka (Jaffna)
Posts: 1,151
Default

The fancy of the ShellExecute is no need to give the associate application name to run/open a program/File, it will take the default application to run the program/File. ShellExecute is more KISS
Reply With Quote
  #8  
Old 08-09-2004, 10:14 PM
Rashka's Avatar
Rashka Rashka is offline
Contributor
 
Join Date: May 2004
Location: Ohio, USA
Posts: 771
Default

If its an .exe, then you only need the path to it, nothing else, it will run with just that....for a file, if you want to open it in its proper viewer, or specify one, then ShellExecute would be better. However in this case, its an .exe, so Shell works for him.
__________________
Brandon

Once you embrace the idea that your customers deserve to die...
...it frees your mind to invent splendidly profitable products - Dogbert
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

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
 
 
-->