Need help on the shell command

P

Thread Starter

Paul Dacre

i need to know how to make a shell command work.
i know to use it like this:
shell ("C:/abc/123.exe")
but how can i use it like this
shell ("../../games/solitare.exe")

kind of the same as the HTML format for local links.

because i am putting this project onto a cd and then needs to find a file on the CD, but because people have different CD drive letters (d:,m: etc.)

thanks
 
Hi,

Have you looked at the "Winseek.vbp" sample project in VB? You may be able to use some of the code to solve your problem.

If not, you could use the GetDriveName method of the FileSystemObject and then set up a loop using the Dir function to find the file. There's some sample code in Help.

Good Luck.
 
R

Rafael Becerra

If the files you are trying to open resides in a Path relative to the application Path (i.e., the application is running from the cd which the other apps resides) you can use the property App.path to get the current path of your running application.

Rafael Becerra
Omnicon Ltda
 
Top