Bonjour,

J'ai besoin de votre aide pour un script VBScript qui me renvoie une erreur de syntaxe à la ligne suivante (47):

Code : Sélectionner tout - Visualiser dans une fenêtre à part
objFSO.CopyFile userPath & "\" & "pst.log" , & NetPath & strComputer & "_" & userUpn & "_" & Now() & "_pst.log" , OverwriteExisting
Je n'arrive pas à voir où est l'erreur à cette ligne.

Voici le code entier:
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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'Option Explicit
'On Error Resume Next
Dim objShell,objFSO,objTextFile,objOutlook,objMAPI,WshNetwork
Dim PSTfolder,userPath,pstPath,strSubString,UserUpn,strComputer
 
 
Const ForWriting = 2
Const OverwriteExisting = True
Set objShell = CreateObject("wscript.shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
UserPath = objShell.ExpandEnvironmentStrings("%userprofile%")
UserUpn = WshNetwork.UserName
strComputer = WshNetwork.ComputerName
NetPath = "\\sa000e\LogsArch$\"
Set objFSO = CreateObject("scripting.filesystemobject")
Set objTextFile = objFSO.OpenTextFile _ 
    (userPath & "\" & Now() & "_pst.log", ForWriting, True) 
 
Set objOutlook = createObject("Outlook.Application")
set objMAPI = objOutlook.GetNamespace("MAPI")
for each PSTFolder In objMAPI.Folders
  pstPath = GetPath(PSTFolder.StoreID)
  if pstPath <> "" Then 
	objTextFile.WriteLine(PSTFolder.name & " : " & pstPath) 
  end if
next
 
function GetPath(input)
  for i = 1 To Len(input) Step 2
    strSubString = Mid(input,i,2)
    if Not strSubString = "00" Then
       strPath = strPath & ChrW("&H" & strSubString)
    end If
  next
 
  select Case True
  case InStr(strPath,":\") > 0
    GetPath = Mid(strPath,InStr(strPath,":\")-1)
  case InStr(strPath,"\\") > 0
    GetPath = Mid(strPath,InStr(strPath,"\\"))
  end Select
end Function
 
 
objTextFile.Close
 
objFSO.CopyFile userPath & "\" & "pst.log" , & NetPath & strComputer & "_" & userUpn & "_" & Now() & "_pst.log" , OverwriteExisting
 
 
set objTextFile = Nothing
set objFSO = Nothing
set objOutlook = Nothing
set objMAPI = Nothing
set objShell = Nothing
Je vous remercie par avance de votre aide.