800A01AD - Un composant activex ne peut pas créer un objet

VBScript37 Messages postés 6 Date d'inscription lundi 18 avril 2005 Statut Membre Dernière intervention 22 avril 2005 - 18 avril 2005 à 21:16
wassim.azzouzi Messages postés 1 Date d'inscription samedi 28 septembre 2013 Statut Membre Dernière intervention 28 septembre 2013 - 28 sept. 2013 à 14:39
Slt,



En utilisant le script ci dessous, j'ai droit à une erreur de ce type
dés la 1ère ligne , je ne comprends pas à quoi c'est dû, avez vous une
idée sur la façon de remédier à ce problème:



800A01AD "un composant activex ne peut pas créer un objet"



Voici un lien interessant, mais je n'arrive pas à résoudre mon problème avec:

http://www.computerperformance.co.uk/Logon/code/code_800A01AD.htm



Merci bcp à celui qui pourra m'aider car c'est important



Voici le code:





Dim tablocalisation(1)

Set shell = CreateObject("WScript.Shell")

Set fSo = CreateObject("Scripting.FileSystemObject")

tablocalisation(0)="xxx"

tablocalisation(1)="xxx"

sTargetPath="\\xxxxxx"

Set f = fSo.GetFolder("C:\Documents and Settings")

Set sf = f.SubFolders





langue=shell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language\InstallLanguage")



If langue = "0409" Then

Start = "\Start Menu"

else

Start = "\Menu Démarrer"

End if





For Each f1 in sf

Efface(f1)

Next







sPath="C:\Documents and Settings\All Users" & start & "xxxxxxxx"



Set oFolder=fSo.CreateFolder(sPath)

oFolder.Attributes=4

Set oFolder=Nothing

Set oLink=WshShell.CreateShortcut(sPath & "target.lnk")

oLink.TargetPath=sTargetPath

oLink.Save

Set oLink=Nothing

Set oTs=fSo.CreateTextFile(sPath & "desktop.ini")

oTs.WriteLine "[.ShellClassInfo]"

oTs.WriteLine "CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}"

oTs.WriteLine "Flags=2"

oTs.WriteLine "IconFile=""\\xxxxxxxxxx"""

oTs.WriteLine "IconIndex=0"

oTs.WriteLine "ConfirmFileOp=0"

oTs.Close





Sub Efface(f2)

For j=0 to ubound(tablocalisation)

sPath="C:\Documents and settings" & f2.name & Start & tablocalisation(j)

If fSo.folderExists(sPath) Then

Set parentFolder = fSo.GetFolder(sPath)

parentFolder.attributes = 0

if fSo.FileExists(sPath & "\target.lnk") Then


Set file =
fSo.GetFile(sPath & "\target.lnk")

file.attributes = 0

fSo.deleteFile(sPath & "\target.lnk")

End if

If fSo.fileExists(sPath & "\desktop.ini") then


Set file =
fSo.GetFile(sPath & "\desktop.ini")

file.attributes = 0

fSo.deleteFile(sPath & "\desktop.ini")

End if

fSo.DeleteFolder(sPath) , True

End if

Next

End Sub
A voir également:

8 réponses

wassim.azzouzi Messages postés 1 Date d'inscription samedi 28 septembre 2013 Statut Membre Dernière intervention 28 septembre 2013 4
28 sept. 2013 à 14:39
Si le problème est sr un poste qui tourne sous 64 bits, la solution est la suivante :
il suffit de le lancer avec c:\windows\syswow64\cscript.exe

http://www.code-source.net/content/lancer-un-script-vbs-sur-une-plateforme-64-bits
4