Bonjour,

J'ai un souci incompréhensible ...
Mon script test l'existence d'un répertoire et le supprime.
Pourtant j'arrive à avoir une erreur lors de la tentative de suppression :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
StrComputer = wscript.arguments(0)
 
RepName = "\\" & StrComputer & "\c$\Documents and Settings\"
 
		For i = 1 TO 99999
 
			if i > 0 and i < 10 then RepPath = RepName & "a0000" & i
			if i > 9 and i < 100 then RepPath = RepName & "a000" & i
			if i > 99 and i < 1000 then RepPath = RepName & "a00" & i
			if i > 999 and i < 10000 then RepPath = RepName & "a0" & i
			if i > 9999 and i < 100000 then RepPath = RepName & "a" & i
 
		If oFSO.FolderExists(RepPath) = True Then oFSO.DeleteFolder RepPath, True
		Next
Ligne : 15
Caract. : 45
Erreur : chemin d'accès introuvable
Code : 800A004C
Je n'arrive pas à comprendre l'origine du souci ... LCase, Ucase, format de ma variable RepName ... ???
Comment ce répertoire peut-il exister et ne pas exister ?