You are on page 1of 1

Option Explicit

Dim strFolder
Dim strFile

Dim objShell
Dim objFolder
Dim objFolderItem

With WScript.CreateObject("Scripting.FileSystemObject")
strFolder = .GetParentFolderName(WScript.ScriptFullName)
strFile = .GetBaseName(WScript.ScriptName) & ".inf"
End With

Set objShell = WScript.CreateObject("Shell.Application")


Set objFolder = objShell.NameSpace(strFolder)

If Not objFolder Is Nothing Then


Set objFolderItem = objFolder.ParseName(strFile)

If Not objFolderItem Is Nothing Then


objFolderItem.InvokeVerb "Install"

Set objFolderItem = Nothing


Else
WScript.Echo "Can't find [" & strFile & "] in [" & strFolder & "]"
End If

Set objFolder = Nothing


Else
WScript.Echo "Can't find [" & strFolder & "]"
End If

Set objShell = Nothing

WScript.Quit 0

You might also like