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:
[quote]800A01AD "un composant activex ne peut pas créer un objet"[/quote]
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