Skip to content

Instantly share code, notes, and snippets.

@SteGriff
Created November 9, 2017 10:19
Show Gist options
  • Save SteGriff/b247f5a95b5a4a35c2a22e87016427ec to your computer and use it in GitHub Desktop.
Save SteGriff/b247f5a95b5a4a35c2a22e87016427ec to your computer and use it in GitHub Desktop.
A foolproof 32/64 bit regasm script
@echo off
REM
REM Fill in your DLL directory on the cd line
REM Fill in your DLL name on the two RegAsm lines
REM
echo "Registering (thing)..."
cd "%programfiles(x86)%\Location\OfMy\Library"
echo "Changed directory. Trying 32 bit..."
%WINDIR%\Microsoft.Net\Framework\v4.0.30319\RegAsm.exe MyLibrary.dll /tlb /codebase
if ERRORLEVEL 100 (
echo "Trying 64 bit..."
%WINDIR%\Microsoft.Net\Framework64\v4.0.30319\RegAsm.exe MyLibrary.dll /tlb /codebase
)
echo "Finished registering"
echo:
echo %ERRORLEVEL%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment