Last active
December 15, 2015 13:09
-
-
Save segilbert/5265752 to your computer and use it in GitHub Desktop.
Obtains the public key token from a strong key or dll.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
REM | |
REM http://msdn.microsoft.com/en-us/library/k5b5tt23(v=vs.80).aspx | |
REM http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd | |
REM | |
SET SnkFilePath=%1 | |
SET FileExt=%~x1 | |
REM ECHO %FileExt% | |
IF "%FileExt%"==".dll" ( | |
sn -T %SnkFilePath% > OnlyToken.txt | |
) ELSE ( | |
sn -p %SnkFilePath% OnlyPublic.snk | |
sn -t OnlyPublic.snk > OnlyToken.txt | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
REM | |
REM http://msdn.microsoft.com/en-us/library/k5b5tt23(v=vs.80).aspx | |
REM http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd | |
REM | |
SET DirPath=%1\ | |
SET verbosity=%2 | |
REM ECHO %DirPath% | |
FOR /f %%a IN ('dir /b /s "%DirPath%*.dll"') DO ( | |
IF "%verbosity%"=="verbose" ( | |
ECHO | |
ECHO "*************************" | |
ECHO "File -> " %%a | |
sn.exe -T %%a | |
ECHO "*************************" | |
ECHO | |
) ELSE ( | |
ECHO "File -> " %%a | |
sn.exe -T %%a | |
) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment