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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a CONFIG.FPW (or .PRG)M/S VFP 9.0 from a shortcut 2

Status
Not open for further replies.

billperryswb

Programmer
Nov 11, 2010
2
I have created a shortcut I want to use to start a VFP 9.0 application.

I cannot get VFP to run my -CC:\<dir>\<subdir>\CONFIG.FPW -OR- -CC:\<dir>\<subdir>\CONFIG.PRG from "Target" in the
shortcut.

Instead VFP just starts and presents the Command window etc.

I have tried:

"C:\Program Files (x86)\Microsoft Visual FoxPro 9\vfp9.exe" -cc:\aaafox\stock\config.FPW

"C:\Program Files (x86)\Microsoft Visual FoxPro 9\vfp9.exe" -cc:\aaafox\stock\config.PRG

"C:\Program Files (x86)\Microsoft Visual FoxPro 9\vfp9.exe
-cc:\aaafox\stock\config.FPW"

"C:\Program Files (x86)\Microsoft Visual FoxPro \vfp9.exe
-cc:\aaafox\stock\config.PRG"

in "Target" in the shortcut.

I have to be doing something simple wrong.

I know VFP was meant to let me do this (I did it on Foxpro 2.x without a problem).

Any ideas?

Thanks a bunch

SWB

 
You can configure your VFP session to run a particular .prg in the "Tools->Options->Startup Program" settings if you want it to run every time you start VFP.

If you want VFP to run a program from a config.fpw file, add COMMAND=MyProgram.prg to the config file.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
You can't use command-line switches to launch a program. Your command line will correctly load the Config file, but will then just load the VFP development environment.

If you want to create shortcuts to run different applications, create a Config.FPW for each application. In each Config.FPW, insert a line:

COMMAND = DO MyProgram.PRG

where MyProgram.PRG is the name of the root program of the application. (This could just as well be a DO FORM command, or a command to launch a menu.)

Then, in each shortcut, include the -C clause (as you are already doing) to specify the config file.

But a better approach would be to compile each application into a APP or EXE file. You can then launch that file directly from the shortcut, without worrying about a Config file, and without any command-line switches.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
-CFileName is the correct command switch to make foxpro use some fpw. You can't determine a prg via that switch, but inside the config.fpw file can have a line "COMMAND =..." with a start command, which of course can be the call to a prg. This is possible additionally to what Dave says about the Startup Program option.

Your syntax of -cc:\aaafox\stock\config.FPW also seems correct, so double check if FILE("c:\aaafox\stock\config.FPW") is true. You could for example have created a txt file via Vista/Win7 Explorer and named it config.fpw, but have blended out file extension, and thus only have c:\aaafox\stock\config.FPW.txt, but not c:\aaafox\stock\config.FPW

Bye, Olaf.
 
Besides all that the normal way to actually start an application written in VFP is to a) Compile it as EXE and then b) start that EXE, not foxpro. VFP9.exe is not among the redistributable files, as it's the VFP IDE itself and not the runtime.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top