Dim regClr
Set regClr = DotNetFactory.CreateInstance("Microsoft.Win32.Registry", "mscorlib").ClassesRoot

If IsEmpty(regClr.OpenSubKey("AutoItX3.Control")) Then
Dim sbjNode, attachmentFilter, attachmentList, attachment
Dim fso, autoItX3File

'This is the name and destination path for the AutoItX3.dll file
Dim autoItX3DllName, autoItX3DllPath
autoItX3DllName = "AutoItX3.dll"
autoItX3DllPath = "C:WINDOWSsystem32" & autoItX3DllName

'Isolate the file in QC and download it
Set sbjNode = QCUtil.TDConnection.TreeManager.TreeRoot("Subject")
Set attachmentFilter = sbjNode.Attachments.Filter
attachmentFilter.Filter("CR_REFERENCE") = "'ALL_LISTS_" & sbjNode.NodeID & "_" & autoItX3DllName & "'"
Set attachmentList = attachmentFilter.NewList
Set attachment = attachmentList.Item(1)
attachment.Load True, ""

'Move it to the destination path
Set fso = CreateObject("Scripting.FileSystemObject")
Set autoItX3Dll = fso.GetFile(attachment.FileName)
autoItX3Dll.Copy(autoItX3DllPath)

'Register it
Set WshShell = CreateObject("WScript.Shell")
WshShell.Exec "RegSvr32 /s " & autoItX3DllPath

'Release objects
Set sbjNode = Nothing
Set attachmentFilter = Nothing
Set attachmentList = Nothing
Set attachment = Nothing
Set autoItX3Dll = Nothing
Set fso = Nothing
Set WshShell = Nothing
End If

Set regClr = Nothing