regsvr32 wsh
Dim objShell Set objShell = CreateObject("WScript.Shell") objShell.Run "regsvr32.exe c:\windows\system32\whatever.dll"
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Dim objShell Set objShell = CreateObject("WScript.Shell") objShell.Run "regsvr32.exe c:\windows\system32\whatever.dll"
Function RunOutput(cProgram, nWindowType) '-- Obtain a Temporary File Name Dim oFS Set oFS = CreateObject("Scripting.FileSystemObject") Dim cFile cFile = oFS.GetSpecialFolder(2).Path & "\" & oFS.GetTempName '-- Execute the command and redirect the output to the file Dim oShell Set oShell = CreateObject("WScript.Shell") oShell.Run cProgram & " >" & cFile, nWindowType, True Set oShell = Nothing '-- Read output file and return Dim oFile Set oFile = oFS.OpenTextFile(cFile, 1, True) RunOutput = oFile.ReadAll() oFile.Close '-- Delete Temporary File oFS.DeleteFile cFile Set oFS = Nothing Set cFile = Nothing End Function