Probleme de Permission lors de COPYFILE - VB/VBA/VBS - Programmation
Marsh Posté le 18-06-2006 à 20:52:44
J'ai essaye avec le code suivant meme probleme 
 
Option Explicit 
Const Path = "c:\" 
Const str = "doc" 
Const OverWriteFiles = TRUE 
 
'Function SearchFile(strPath) 
 
Dim FSO,REP,ColFiles,Fichiers,Wscript,objDoc 
 
 
    Set FSO = CreateObject("Scripting.FileSystemObject" ) 
    Set Rep = FSO.GetFolder(Path) 
    Set ColFiles = Rep.Files 
     
    For Each Fichiers In ColFiles 
 
    if str = FSO.GetExtensionName(Fichiers) Then 
    Fichiers.copy "c:\donnee" 
    else 
    End If 
     
    Next
Marsh Posté le 18-06-2006 à 22:01:20
Bon J'ai Trouver 
 
Option Explicit  
Const Path = "c:\"  
Const str = "doc"  
Const OverWriteFiles = TRUE  
  
'Function SearchFile(strPath)  
  
Dim FSO,REP,ColFiles,Fichiers,Wscript,objDoc  
  
  
    Set FSO = CreateObject("Scripting.FileSystemObject" )  
    Set Rep = FSO.GetFolder(Path)  
    Set ColFiles = Rep.Files  
      
    For Each Fichiers In ColFiles  
  
    if str = FSO.GetExtensionName(Fichiers) Then  
    Fichiers.copy "c:\donnee\"  
    else  
    End If  
      
    Next 
 
Il Manquai "\" apres donnee quel erreur de ma part 
Merci comme meme d'avoir aider
Marsh Posté le 18-06-2006 à 20:40:58
Option Explicit
Const Path = "c:\"
Const str = "doc"
Const OverWriteFiles = TRUE
Dim FSO,REP,ColFiles,Fichiers,Wscript,File
Set FSO = CreateObject("Scripting.FileSystemObject" )
Set Rep = FSO.GetFolder(Path)
Set ColFiles = Rep.Files
For Each Fichiers In ColFiles
if str = FSO.GetExtensionName(Fichiers) Then
FSO.copyFile Fichiers ,"c:\donnee"
else
End If
Next
Salut a tous J'ai un soussi lors de l'execution de mon VBS
je recupere une erreur 70 probleme permission refusee sur la ligne ou j'effectue la copy
Kelkun connai une solution
merci d'avance