Bonjour,

Je suis actuellement en train d'adapter un script en VBS qui permet d'intervenir sur Windows Update et de mettre à jour une machine avec une interface en HTA et je rencontre un problème : lorsque je le lance en invite de commande avec cscript pas de problème, mais si je le lance via l'interface HTA (sur un clic par exemple) ça plante.

Le voici, j'ai mis erreur à la ligne 29 en erreur en rouge :

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
Sub InstallAllUpdates()
 
    ' Initialize the variables.
    dim updatesDeployment
    dim progress
    dim updateCount
    dim update
    dim updatesList
 
    ' Create the UpdatesDeployment instance.
    set updatesDeployment = CreateObject ("UDA.CCMUpdatesDeployment")
 
    ' Get the current updates.
    Set updatesColl = updatesDeployment.EnumerateUpdates( 2, 0, progress )
 
    ' Get a count of the available updates.
    updateCount = updatesColl.GetCount()
 
    ' Before installing, determine whether another job is already in progress.
    if progress = 0 then 
 
        if updateCount > 0 then
 
            ' Create array to hold update IDs.
            Redim updatesList(updateCount-1)
 
            ' Get the ID for each update.
            for nIndex = 0 To updateCount-1
                Set update = updatesColl.GetUpdate(nIndex)
                updatesList(nIndex) = update.GetId()
            next
 
            ' Download and install the update and check the location before initiating the download.
            updatesDeployment.InstallUpdates updatesList, 0, 8
 
            infodownloadinstall.innerHTML = "Successfully started installation of the updates."
 
        else       
            infodownloadinstall.innerHTML = "No updates need to be installed."     
        end if
 
    else    
            infodownloadinstall.innerHTML = "Another update installation is in progress."
    end if 
 
End Sub
Encore une fois le script fonctionne très bien en invite de commande avec cscript, mais lorsque j'essaye de l'utiliser via une interface HTA j'ai l'erreur suivante :

Erreur : Impossible d'effectuer l'opération à cause de l'erreur suivante 80040215
Code : 0
Est-ce que quelqu'un aurait déjà eu ce problème et saurait comment le résoudre ?

Par avance merci.