Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desktop shortcuts with variable drive letters 1

Status
Not open for further replies.

SteveBoard

Programmer
Nov 1, 2002
35
US
I've created a VFP program with all files on a CD. I'd like to have a shortcut visible on the CD root which will call the VFP executable.

The problem is the CD drive varies from one person to the next. Windows will make a shortcut but requires a hardcoded driveletter (the wizard asks you to browse to your program, then it captures the absolute path).

How would I make a shortcut that launches the program down in a subdirectory, with the CD drive letter omitted or assumed? It seems unnecessary to create an executable to read the current drive just to launch a program on that drive. Suggestions?
 
SteveBoard

Can you not (With the help of an API call or VFP's drivetype) determine the CD drive letter?

? DRIVETYPE("F") && Returns a 5 for a CD.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi

I've created a VFP program with all files on a CD. I'd like to have a shortcut visible on the CD root which will call the VFP executable.

I assume that you have the executable and all related files in your CD. What you need is a AUTORUN in your CD so that when the CD is inserted, it will start the executable.

WIth in your application, do not hard code any drive letter. I assume you have not done that and used only relative path. Then what all you need is AUTORUN. That is quite easy..

Create a AUTORUN.inf and add it to your CD
AutoRun.INF
***********
[AUTORUN]
ICON=myApplication.ICO
OPEN=myApplication.EXE

Add the icon file and suitable relative path in above.

:)


ramani :)
(Subramanian.G)
 
Thanks for these good responses to my question.

I knew VFP or VB would let me query current drive, current directory, but I was trying to avoid writing another program to call the main programs.

The autorun.inf does work and I've adopted that as my solution. This has to be enabled on the application system.

Autorun.inf only runs one program, of course, so I still wish for something the user could click on for various run choices. I may wind up creating a menu in Visual Basic. There you would click on the program of your choice, the path would shift to that program, and it would be executed. The last time I reviewed VB, you run another .EXE with "shell." Maybe that's changed.

In DOS days, we used batch files for this purpose but I don't think people today still use them. Or do they?

Thanks again.
 
SteveBoard,

I usually use a commercial solution for this called MenuOrc:

However, I have also used VFP and VB to create switchboard type interfaces for the user to select what to run such as different installs, utilities, pdf manuals, etc.

If you are already using VFP I wouldn't create your interface using VB, this will just add complexitiy via more runtimes, two-languages etc. VFP is very capable of creating this interface you want to run from the CD. And, you will most likely want to use ShellExecute API calls in your code with relative paths.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top