Here is a UNDEBUGGED script to get a list of all the assemblies in the GAC using the GacUtil commandline
;***************************************************************************
;** GACUtil to StdOut
;**
;** Purpose: List All Assemblies in GAC Glocal Assembly Cache
;** Inputs:
;** Outputs: Results in an array which can be searched
;** Reference:
;** REQUIRES WinBatch 2013A or newer
;**
;** Developer: Deana Falk 2014.04.16
;***************************************************************************
GoSub UDFS
;***************************************************************************
;**
;** Tab delimited list of assemblies
;**
;***************************************************************************
gaclist = EnumGACAssemblies( 0 )
count = ItemCount( gaclist, @tab )
AskItemList(count, gaclist, @tab, @sorted, @single )
;***************************************************************************
;**
;** Array of assemblies
;**
;***************************************************************************
array = EnumGACAssemblies( 1 )
MyDialogFormat=`WWWDLGED,6.2`
MyDialogCaption=`WIL Dialog 1`
MyDialogX=002
MyDialogY=059
MyDialogWidth=436
MyDialogHeight=353
MyDialogNumControls=003
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0
MyDialog001=`113,323,036,012,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`265,325,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`005,005,422,306,REPORTVIEW,"ReportView_1",array,DEFAULT,DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("MyDialog")
Exit
;***************************************************************************
;***************************************************************************
;***************************************************************************
:UDFS
#DefineFunction EnumGACAssemblies( type ) ; TYPE: 0 = tab delimited list, 1 = array
output = FileCreateTemp( 'GAC' )
gacutil = 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe'; FileLocate('gacutil.exe')
;DirChange( FilePath(gacutil) )
If !FileExist( gacutil )
Pause( 'EnumGACAssemblies Error', 'Unable to locate gacutil.exe' )
Exit
Endif
assemblyname = ''
CaptureArray=CaptureDosOutput(`cmd.exe /c "`:gacutil:`" /l `:assemblyname) ; for built-in dos commands
;Pause(StrCat("Exit code: ",CaptureArray[0]),CaptureArray[1])
If CaptureArray[0] !=0
Pause("CaptureDosOutput Error",CaptureArray[2])
Exit
Endif
If !FileExist( output )
Pause( 'EnumGACAssemblies Error', 'Unable to generate output' )
Exit
Endif
gaclist = CaptureArray[1]
gaclist = StrReplace( gaclist, @crlf:@crlf, @tab )
gaclist = StrReplace( gaclist, @crlf, @tab )
For x = 1 to 3
gaclist = ItemRemove( 1, gaclist, @tab )
Next
gaclist = ItemRemove( -1, gaclist, @tab )
gaclist = ItemRemove( -1, gaclist, @tab )
If type == 1
gaclist = Arrayize( gaclist, @tab )
Endif
;AskItemList(count, gaclist, @tab, @unsorted, @single )
FileDelete( output )
Return gaclist
#ENDFunction
#DefineFunction CaptureDosOutput(DosCommand)
DataArray=ArrDimension(3) ;Allocate return array
ArrInitialize(DataArray,"") ;initialize to all null strings
oShell = ObjectOpen("WScript.Shell") ;open shell object
oScriptExec = oShell.Exec(DosCommand) ;run the command
;Open output objects
oStdOut = oScriptExec.StdOut
oStdErr = oScriptExec.StdErr
While (oScriptExec.Status==0) ;wait for completion
;Caputure StdOut data
oStdOut = oScriptExec.StdOut
While ! oStdOut.AtEndOfStream
strLine = oStdOut.ReadLine
DataArray[1] = StrCat(DataArray[1],strLine,@CRLF)
EndWhile
;Capture StdErr data
oStdErr = oScriptExec.StdErr
While ! oStdErr.AtEndOfStream
strLine = oStdErr.ReadLine
DataArray[2] = StrCat(DataArray[2],strLine,@CRLF)
EndWhile
TimeDelay(0.1)
EndWhile
;Get remainder of data, if any
;Caputure StdOut data
oStdOut = oScriptExec.StdOut
While ! oStdOut.AtEndOfStream
strLine = oStdOut.ReadLine
DataArray[1] = StrCat(DataArray[1],strLine,@CRLF)
EndWhile
;Capture StdErr data
oStdErr = oScriptExec.StdErr
While ! oStdErr.AtEndOfStream
strLine = oStdErr.ReadLine
DataArray[2] = StrCat(DataArray[2],strLine,@CRLF)
EndWhile
DataArray[0]=oScriptExec.ExitCode ;save errorlevel/exit code
;Close handles that were opened
ObjectClose(oStdOut)
ObjectClose(oStdErr)
ObjectClose(oScriptExec)
ObjectClose(oShell)
;Return the array
Return(DataArray)
#EndFunction
RETURN