Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mapping and Unmapping
Message
 
 
À
17/09/1998 12:47:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00137678
Message ID:
00137898
Vues:
20
>Try the API call SetEnvironmentVariable, which prototypes as:
>
>
>   DECLARE SHORT SetEnvironmentVariable IN WIN32API ;
>           STRING lpName, ;
>           STRING lpValue
>
>lpName should be the name of the environment variable to set (in this case, "PATH"), and lpValue should be the full path value to set, null-terminated.  This only sets the enviroment variable in the context of the current process.

This is the entire code I have tried.<pre>
DECLARE Integer WNetAddConnection IN WIN32API STRING @, STRING @, STRING @

lcRemoteName = "\\R6Vabs\Vol1\OraApps\OraWin95\Bin" + chr(0)
lcPassword = ""    && Connect using no password, already authenticated
lcLocalName = "I:" + chr(0)

lnRetVal = WNetAddConnection( @lcRemoteName, @lcPassword, @lcLocalName)

*-- lnRetVal is 0 and I can verify that I: now exists to the path specified

DECLARE SHORT SetEnvironmentVariable IN Win32API;
   STRING @lpname, STRING @lpszValue
lcName = 'PATH'
lcPath = getenv("PATH") + ";I:." + Chr(0)
lnRresult = SetEnvironmentVariable(@lcname, @lcpath)
clear
?
?
? getenv("PATH")    && still shows old path
return
At the end of the rope at this point.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform