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

How do I set the FPD path in WindowsXP?

Status
Not open for further replies.

amartureo

Programmer
May 1, 2002
29
0
0
US
My DOS Foxpro program is normally run on computers with WIN98SE. The program files are in a different directory than the data files. When the program initiates, the data directory is set as the default directory and additional program files are found in the path set via a batch file run with the PIF.

This system doesn't work with Windows XP. XP will start my program but as soon as the default directory is set to the data directory, it doesn't recognize the path to other program files.

How do I get XP to find the files? How do I get XP to search a given PATH?
 
Rather than setting the path "in the path set via a batch file run with the PIF."

Why don't you set your path within your program itself.

The &quot;generic&quot; command is SET PATH TO <whatever>

You &quot;could&quot; hard-code it, but I would not recommend it. Instead You could build code which will identify where the program started from there build relative paths to the other directories.

Example:
mcStartUp = SYS(5) + SYS(2003)
< build relative paths here >
mcDataDir = <determined by previous code>
mcPrgDir = <determined by previous code>
mcPath = mcDataDir + &quot;;&quot; + mcPrgDir
SET PATH TO (mcPath)

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Hi amartureo,

Try this
************************
DbfPath=getdir()
use DbfPath+&quot;Dbf1&quot;
use DbfPath+&quot;Dbf2&quot;
************************

 
The PATH and DEFAULT sets should work as they always have. Just remember that FPD and FPW require folders (directories) and file names in the old DOS 8.3 format. So if you have a directory like &quot;C:\Program Files\Internet Explorer\Connection Wizard\&quot;, you'll need to use &quot;C:\PROGRA~1\INTERN~1\CONNEC~1\&quot;.

Rick
 
Why not put the path to the data in an INI file, then read it into a variable in your app, say &quot;cDataPath&quot;. Then whenever you open tables do:

USE (cDataPath + &quot;mytable&quot;)

Doing it by setting DOS paths is really not the best approach.

***************************************
Need help running those old FoxPro apps on modern systems?
 
Hi amartureo,

You can try to modify the &quot;set path&quot; from c:\%windir%\system32\autoexec.nt.
Or, you cant try to modify the &quot;Environment Variables&quot; from: Control Panel\System Properties\Advanced\Environment Variables, and here System variables=> Path.

Octavian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top