Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the directory to home directory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00399588
Message ID:
00399669
Vues:
14
Hi Marvin,

In the Target field of my Shortcut I have c:\mydir\myexe.exe. In the START IN I have c:\mydir

I run a program when I start Fox that tells It were my data is and my forms and programs are located :

SET DEFAULT TO C:\mydir && This is were I have my forms and programs etc

CHDIR('C:\mydir\myDATA\') && I change dir's to were my data is
G_CPATH= CURDIR() && I set the current dir to a Public Var so I can check it
SET PATH TO (G_CPATH) && I then set the search path to the location of the data
OPEN DATABASE SYS(5)+'\mydata\my.dbc' SHARED && Then I open the dbc shared
CHDIR('d:\mydir\') && I then set the dir back to were my forms and programs are.

I use the same basic set up for my exe except I leave the last Chdir out.

I tested the my short cut with the Start In field blank and it will still work.

Hope this helps

R D Black


>if someone references my program (EXE) with a shortcut, but there is no working directory set, my program gets an error because the current directory is not the directory that my program is located in.
>
>Is there a way at the beginning of my program to change the directory to the directory that contains the called EXE?
>
>This should be easy. I tried home, but it returns the winnt\system32 directory even if the dll's are in that directory, I guess they're in both directories.
>
>Thanks!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform