Trouver le Root Directory ?

DiJiTooL Messages postés 78 Date d'inscription samedi 4 août 2001 Statut Membre Dernière intervention 29 mars 2007 - 16 juin 2003 à 14:24
DiJiTooL Messages postés 78 Date d'inscription samedi 4 août 2001 Statut Membre Dernière intervention 29 mars 2007 - 16 juin 2003 à 20:07
Voila je voulais savoir si il y a une fonction pour indquer le Root directory de windows ( System32 )

Je sais qu'il y a des variable tels que %systemroot% donc peut etre que l'on peut les utiliser...

Merci d'avance

2 réponses

rclsilver02 Messages postés 130 Date d'inscription mercredi 19 mars 2003 Statut Membre Dernière intervention 10 février 2012
16 juin 2003 à 17:45
je pense que tu arriveras à comprendre ce code :

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Private Sub Command1_Click()
 Dim Buffer As String
 Dim Size As Long
 Size = GetWindowsDirectory(vbNullString, 0)
 Buffer = String(Size, " ")
 Size = GetWindowsDirectory(Buffer, Size)
 Buffer = Left(Buffer, Size)
 MsgBox "Répertoire de Windows: " & Buffer
End Sub



Le chemin est dans la variable Buffer

Bonne programmation
Rclsilver02
0
DiJiTooL Messages postés 78 Date d'inscription samedi 4 août 2001 Statut Membre Dernière intervention 29 mars 2007
16 juin 2003 à 20:07
ça marche impec !!
merci bcp :)
0
Rejoignez-nous