Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding the Directory of Exe
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00046135
Message ID:
00046190
Vues:
24
>I have two exe's. The first exe begins running, then it calls the second exe with a DO command. For example:
>DO &path.commonrpt.exe WITH parameter1, parameter2
>
>I am trying to find a way the second program can locate itself so that I can tell it where to find an init file without any hard coding.
>
>When I use the GetCurrentDirectory() Win32Api call, it returns the path to the original calling program. If I run commonrpt.exe on its own this function works well.
>
>FULLPATH("commonrpt.exe") and LOCFILE("commonrpt") do not work because if the file is not found in the default or paths then it will either return the default directory with commonrpt.exe attached to the end or an open dialog box. Either the data is incorrect or the automatted process halts with a dialog box.
>
>I don't want to pass the path to the exe as a parameter of the DO command.
>
>Does anyone have any suggestions or solutions??
>
>Thank You,
>Michael

since you have the path in the exe, could you save the value of FULLPATH( "" ), set default to your path, call your exe, then set default back after the call. in the second exe, FULLPATH("" ) should return the correct dir.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform