OVH Cloud OVH Cloud

Fichier systeme

2 réponses
Avatar
Samoht
Bonjour,

comment savoir ou se trouve les fichiers system selon l'os:
windows\system
Winnt\system32
etc..

du genre : system.path

Merci !

2 réponses

Avatar
Zoury
Salut Samoth! :O)

<non testé>
'***
' Module1
Option Explicit

Private Declare Function GetSystemDirectoryA _
Lib "kernel32" _
( _
ByVal lpBuffer As String, _
ByVal nSize As Long _
) As Long

Private Const MAX_PATH As Long = 260

Private Sub Main()
Debug.Print GetSystemDirectory
End Sub

Private Function GetSystemDirectory() As String
GetSystemDirectory = String$(MAX_PATH, Chr$(0))
GetSystemDirectory = Left$(GetSystemDirectory,
GetSystemDirectoryA(GetSystemDirectory, MAX_PATH))
End Function
'***

--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/

Merci de poster les réponses au groupe afin d'en faire profiter à tous
Avatar
Samoht
Merci beaucoup ça marche au poil !
-----Message d'origine-----
Salut Samoth! :O)

<non testé>
'***
' Module1
Option Explicit

Private Declare Function GetSystemDirectoryA _
Lib "kernel32" _
( _
ByVal lpBuffer As String, _
ByVal nSize As Long _
) As Long

Private Const MAX_PATH As Long = 260

Private Sub Main()
Debug.Print GetSystemDirectory
End Sub

Private Function GetSystemDirectory() As String
GetSystemDirectory = String$(MAX_PATH, Chr$(0))
GetSystemDirectory = Left$(GetSystemDirectory,
GetSystemDirectoryA(GetSystemDirectory, MAX_PATH))
End Function
'***

--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
http://faq.vb.free.fr/?rubrique=0 -


http://www.mvps.org/vbnet/
http://www.mentalis.org/agnet/apiguide.shtml -


http://www.mztools.com/

Merci de poster les réponses au groupe afin d'en faire


profiter à tous


.