est ce que ce code tourne sous win2000?
ou est ce que je pourrais trouver une explication meme technique, (et surtout technik...) en ce qui concerne ces fichiers (espions...caésur...) index.dat...
Vu que 2000 utilise les securité NTFS, la gestion de compte, le fichier à l'air bcp moins facile à écraser...si qq'un a des infos...merci, 1000 fois merci...car il me fait sacrement batailler...cet index.dat..
thx

-------------------------------
Réponse au message :
-------------------------------
Index.dat n'est pas effacable( sinon, je ne sais pas comment faire). Par contre, il peut être purgé, mais Windows le recrée au démarage dans ce cas.
Testé sur System Win9x, tu peux essayer ça :
************************************************************
DANS UNE FORM
************************************************************
Public Sub form_load()
'Localisation de index.dat (pidl=pointer ident. direct. Location)
Dim location As String, pidl As Long
Dim ChemIndex As String
location = Space$(260)
SHGetSpecialFolderLocation Me.hWnd, CSIDL_COOKIES, pidl
SHGetPathFromIDList pidl, location
ChemIndex = Left(location, Len(RTrim(location)) - 1) & "\index.dat"
'Suppression des attributs de index.dat
Dim fso, f, fichier As String
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(ChemIndex)
f.Attributes = 0
'Ouverture du fichier & reecriture pour eviter la recreation
'au demarrage de Windows ( ... gros doute ! )
Dim sdata As String, strData As String
strData = "Client UrlCache MMF Ver 5.2" & Space(16353)
Open ChemIndex For Output As #2
Write #2, strData
Close #2
End Sub
************************************************************
DANS UN MODULE
************************************************************
Option Explicit
Public Const CSIDL_INTERNET_CACHE = &H20&
Public Const CSIDL_COOKIES = &H21&
Public Const CSIDL_HISTORY = &H22&
Declare Function SHGetSpecialFolderLocation Lib "shell32" (ByVal hwndOwner As Long, ByVal nFolder As Long, ppidl As Long) As Long
Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidl As Long, ByVal pszPath As String) As Long
Declare Function SHGetSpecialFolderPath Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" (ByVal hWnd As Long, ByVal lpszPath As String, ByVal nFolder As Integer, ByVal fCreate As Boolean) As Boolean
