FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a 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)
Reply to topic    Frihost Forum Index -> Scripting -> Others

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