sigcheck -a -q %windir%\system32\mstsc.exe
- se necessario aggiungere MD5, SHA1, PESHA1, SHA256
sigcheck -a -q -h %windir%\system32\mstsc.exe
- testare la versione ed eseguire il comando:
sigcheck -a -q %windir%\system32\mstsc.exe | find "Prod version:" | find "6.0.6001.18564" && Echo "RDP 6.0.6001.18564"
filever - Strumenti di supporto:
Strumenti di supporto di Windows XP Service Pack 2 o
Strumenti di supporto a 32 bit per Windows Server 2003 Service Pack 2
filever /V %windir%\system32\mstsc.exe
var 2:
filever /V %windir%\system32\mstsc.exe | findstr "FileDesc Version"
filever /V %windir%\system32\mstsc.exe | findstr "ProductVersion" | find "6.0.6001.18564" && Echo "RDP 6.0.6001.18564"
filever /V %windir%\system32\mstsc.exe | findstr "ProductVersion" | find "6.0.6001.18564" || Echo "NOT 6.0.6001.18564"
wmic:
wmic datafile where "name='C:\\<windows dir>\\system32\\mstsc.exe'" get version
PowerShell:
Descrizione del file:
powershell (gi %windir%\system32\mstsc.exe).versioninfo.FileDescription
versione:
powershell (gi %windir%\system32\mstsc.exe).versioninfo ^|Ft -Au
confronto versione script:
$VerArr = [version]"8.2.6001.18564", [version]"6.0.6001.18564"
[version]$v1="8.2.6001.18564"
[version]$v2="6.0.6001.18564"
[version]$v3=(gi $env:windir\system32\mstsc.exe).versioninfo.ProductVersion
$v3
$v3 -ge $v1
$v3 -ge $v2
If ($VerArr -contains $v3)
{
echo 'Run version list block'
}
produzione:
Major Minor Build Revision
----- ----- ----- --------
6 0 6001 18564
False
True
Run version list block
WSH:
cscript //Nologo vers01.vbs
vers01.vbs:
WScript.Echo CreateObject("Scripting.FileSystemObject").GetFileVersion(CreateObject("WScript.Shell").Environment("Process")("WINDIR") & "\system32\mstsc.exe")
JScript:
cscript //Nologo vers01.js
vers01.js:
WScript.Echo(new ActiveXObject("Scripting.FileSystemObject").GetFileVersion(new ActiveXObject("WScript.Shell").ExpandEnvironmentStrings("%windir%")+"//system32//mstsc.exe"));
pefile modyle install: decomprimere, eseguire python setup.py install
import pefile, os
pe = pefile.PE(os.path.join(os.environ['WINDIR'],'system32\mstsc.exe'))
ProductVersion = pe.FileInfo[0].StringTable[0].entries['ProductVersion']
print ProductVersion
PHP:
php vers01.php
php.ini ( %windir%
):
extension_dir = C:\php\ext\
[COM_DOT_NET]
extension=php_com_dotnet.dll
vers01.php:
<?php
$path = getenv('SystemRoot').'\\system32\\mstsc.exe';
$fso = new COM("Scripting.FileSystemObject");
echo $fso->GetFileVersion($path);
?>
Perl:
Installa il modulo Win32 :: File :: VersionInfo: cpan Win32::File::VersionInfo
use Win32::File::VersionInfo;
$fn=$ENV{windir} . "\\system32\\mstsc.exe";
$fl=GetFileVersionInfo($fn);
if($fl){print $fl->{FileVersion},"\n";}