Hello,
Je lance un script VBS avec le compte utilisateur sur un domaine.
J'ai cette erreur :
Et le script est le suivant :
Code :
- Set FSO = CreateObject("Scripting.FileSystemObject" )
- Set objNetwork = CreateObject("Wscript.Network" )
- strUsername = objNetwork.username
- set objWMI = GetObject("winmgmts:root\cimv2" )
- sQuery = "Select * from Win32_process Where Name = 'nlnotes.exe'"
- For Each oproc In objWMI.execquery(sQuery)
- oproc.Terminate()
- Next
- rep = "\\172.16.17.1\save\" & strUserName
- if FSO.FolderExists(rep)Then
- set fold = FSO.GetFolder(rep)
- if fold.Attributes <> 18 then
- fold.Attributes = 18
- end if
- else
- set fold = FSO.CreateFolder(rep)
- set fold = FSO.GetFolder(rep)
- fold.Attributes = 18
- end if
- for i=1 to 8
- select case (i)
- case 1 : source = "c:\lotus\notes\data\"
- destination = rep & "\notes_data\"
- case 3 : source = "C:\Documents and Settings\" & strUserName & "\Bureau\"
- destination = rep & "\Bureau\"
- case 4 : source = "C:\Documents and Settings\" & strUserName & "\Favoris\"
- destination = rep & "\Favoris\"
- case 4 : source = "C:\Documents and Settings\" & strUserName & "\Mes documents\"
- destination = rep & "\Mes documents\"
- end select
- runcopy source, destination
- next
- function runcopy(src, dest)
- if not FSO.FolderExists(dest) then
- set flddest = FSO.CreateFolder(dest)
- end if
- For each Fichier in FSO.GetFolder(src).Files
- set File = FSO.GetFile(Fichier)
- Obj = File.Name
- if not FSO.FileExists(dest & Obj) then
- FSO.CopyFile src & Obj, dest, true
- else
- DestItem = dest & Obj
- set DestObj = FSo.GetFile(DestItem)
- if CDate(File.DateLastModified) > CDate(DestObj.DateLastModified) then
- FSO.CopyFile src & Obj, dest, true
- end if
- end if
- Next
- If FSO.FolderExists(src) Then
- For each Fld in FSO.GetFolder(src).SubFolders
- newdest = dest & Fld.Name & "\"
- newsrc = src & Fld.Name & "\"
- runcopy newsrc, newdest
- Next
- End If
- end function
|
En gros je veux lancer un script qui me copie le repertoire lotus notes, favoris, mes documents et le bureau de l'utilisateur lancant le script. Les données sont copier sur un serveur distant.
Merci d'avance,
Kevin