Bonjour je souhaite installer un msi sur plusieurs machines qui sont listés dans une répertoire par un autre script. Mon probleme est que tout fonctionne sauf à l'instalaltion du msi sur le poste client j'ai une erreure dans le journal d'application : Product: Advitium Client Components -- Internal Error 2103. 26
Merci de votre aide
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 Option Explicit Dim strInstaller 'The command to install the software package Dim strComputer 'The Computer Dim objWMIService Dim strProcess 'The process to terminate before running the command Dim objProcess Dim objFSO, objFSO1, objFSO2 Dim strFilePath 'The filename and path to the installer package Dim strDestination 'the filename and path on the destination computer for the package Dim colProcess Dim intProcessID 'The number assigned to the process that is created Dim fso, fichier, fileItem Dim i, imax Dim objFileCopy Dim errReturn Const DeleteReadOnly = True Const HIDDEN_WINDOW = 1 Const PathMDB = "\\macs16\poste_advitium_test" Set fso = CreateObject("Scripting.FileSystemObject") imax = 0 'début de l'énumération For Each fichier In fso.GetFolder(PathMDB).Files Set fileItem = fso.GetFile(fichier) imax = imax + 1 ReDim Preserve Tableau(1, imax) Tableau(1, imax) = Fichier.Name Set fileItem = Nothing Next 'installation For i = 1 To imax 'Set the variables strComputer = Tableau(1,i) strInstaller = "msiexec.exe /i c:\AdvitiumClientComponents.msi /qn" strProcess = "'iexplore.exe'" strFilePath = "\\macs16\drivers\soft\Advitium\AdvitiumClientComponents.msi" strDestination = "\\" & strComputer & "\c$\AdvitiumClientComponents.msi" 'Display the variables when it runs WScript.Echo "Target Computer: " & strComputer WSCript.Echo "Stopping process " & strProcess WScript.Echo "Command: " & strInstaller WScript.Echo "Package: " & strDestination 'Copy the installer package to the target PC Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFileCopy = objFSO.GetFile(strFilePath) objFileCopy.Copy (strDestination) 'Stop Internet Explorer if it is running Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process Where Name = " & strProcess) For Each objProcess in colProcess objProcess.Terminate() Next 'Start the installer Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2:Win32_Process") errReturn = objWMIService.Create(strInstaller, Null, Null, intProcessID) If errReturn = 0 Then WScript.Echo "Installer was started with a process ID of " & intProcessID 'Set objFSO2 = CreateObject("Scripting.FileSystemObject") 'objFSO2.DeleteFile("\\macs16\poste_advitium\"& strComputer) Else Wscript.Echo strProcess & " could not be started due to error " & errReturn End If Next WScript.Quit
Partager