FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


VB 6 problem executing a .exe program via a visual basic app





andy26
hi i really need some code that will allow me to open any type of exe from my visual basic program, i am trying to creat a portable app program for my usb memory stick, so that when i insert my usb memory stick it will come up with a menu and you can elect certain programs and that is where i need you help i need some code that will open a .exe through my program. thanks in advance
AftershockVibe
Exec method:
http://msdn2.microsoft.com/en-us/library/aa300836(VS.71).aspx
blk3
Have you tries using Shell. I use it sometimes to open other EXEs on my PC like calling WORD or EXCEL for instance.
andy26
what is shell? i could give it ago if i can find out how to do it?
blk3
Shell Function

Shell(pathname[, windowstyle])

Runs the executable program specified by the pathname argument and returns a Variant of subtype Double that represents the program's task ID. If Shell is unsuccessful, it returns zero. The optional windowstyle argument determines the style of the window in which the shelled program runs.
ThePolemistis
andy26 wrote:
hi i really need some code that will allow me to open any type of exe from my visual basic program, i am trying to creat a portable app program for my usb memory stick, so that when i insert my usb memory stick it will come up with a menu and you can elect certain programs and that is where i need you help i need some code that will open a .exe through my program. thanks in advance


Try:

Code:
retval = shell ("c:\windows\calc.exe",1)


replace c:\windows\calc.exe with the file (with its location) you want to open.
If you want to open a directory, try:

Code:
retval = shell ("explorer c:\windows\",1)
Related topics
MS Visual Basic Studio 2005 Express Edition
Visual Basic Tutorial - File I/O in VB: Text Files
Visual Basic Tutorial - Control Arrays: What, Why and How
Visual Basic Programming
help me ..,.,about visual basic
how about security of visual basic 6.0??
Visual Basic 6
VB Help for those who need small pointers in Visual Basic
Is it posible to make skins in visual basic 6
visual basic
Favorite Visual Studio Tool
Visual Basic Build Problem
Visual Basic 6 vs Visual Basic 2010
Visual basic 6
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.