2017年2月4日土曜日

PC WMIC って便利?

msdn Forum (us) の SQL Server Compact カテゴリを偶には覗いて見ます。
最近は、LocalDB のお世話になるケースが増え、 それに伴い、疎遠化していますが ... 。
でも、 こんな発見もあります。
Microsoft さんの製品情報の取得方法についての記述があったのです。  そう、 WMIC と呼ばれるコマンドの活用ですね。


あまり、登場する機会もないとは思いますが、
それだけに、 記憶に刻まれる程度も低く、忘れてしまいそうなので、
備忘録として、書き残して置きます。

WMIC 。


SQL と名の付く もので、 自分の環境に存在するバージョンを列挙する方法です。
但し、 インストールされた全てのプログラムが対象である訳ではありません。
Microsoft を始めとする 正規の方法で作成された もの のみが挙がって来ます。.


cmd.exe から、 以下のコマンドを実行します。

wmic product get name,version | findstr "SQL" | sort


C:¥WINDOWS¥system32>wmic product get name,version | findstr "SQL" | sort
Active Directory Authentication Library for SQL Server                                   13.0.1601.5
Microsoft SQL Server 2008 Management Objects                                             10.0.1600.22
Microsoft SQL Server 2012 Command Line Utilities                                         11.1.3000.0
Microsoft SQL Server 2012 Data-Tier App Framework                                        11.1.2902.0
Microsoft SQL Server 2012 Data-Tier App Framework  (x64)                                 11.1.2902.0
Microsoft SQL Server 2012 Express LocalDB                                                11.1.3000.0
Microsoft SQL Server 2012 Management Objects                                             11.1.3000.0
Microsoft SQL Server 2012 Management Objects  (x64)                                      11.1.3000.0
Microsoft SQL Server 2012 Native Client                                                  11.1.3000.0
Microsoft SQL Server 2012 T-SQL Language Service                                         11.1.3000.0
Microsoft SQL Server 2012 Transact-SQL ScriptDom                                         11.1.3000.0
Microsoft SQL Server 2014 Express LocalDB                                                12.0.2000.8
Microsoft SQL Server 2014 Management Objects                                             12.0.2000.8
Microsoft SQL Server 2014 Management Objects  (x64)                                      12.0.2000.8
Microsoft SQL Server 2014 T-SQL Language Service                                         12.0.2000.8
Microsoft SQL Server 2014 Transact-SQL ScriptDom                                         12.0.2000.8
Microsoft SQL Server 2016 LocalDB                                                        13.0.1601.5
Microsoft SQL Server 2016 Management Objects                                             13.0.1601.5
Microsoft SQL Server 2016 Management Objects  (x64)                                      13.0.1601.5
Microsoft SQL Server 2016 T-SQL Language Service                                         13.0.14500.10
Microsoft SQL Server 2016 T-SQL ScriptDom                                                13.0.1601.5
Microsoft SQL Server Compact 3.5 SP1 x64 日本語版                                        3.5.5692.0
Microsoft SQL Server Compact 3.5 SP1 デザイン ツール日本語版                             3.5.5692.0
Microsoft SQL Server Compact 3.5 SP1 日本語版                                            3.5.5692.0
Microsoft SQL Server Compact 4.0 SP1 x64 ENU                                             4.0.8876.1
Microsoft SQL Server Data Tools - enu (12.0.60629.0)                                     12.0.60629.0
Microsoft SQL Server Data Tools Build Utilities - enu (12.0.30919.1)                     12.0.30919.1
Microsoft SQL Server System CLR Types                                                    10.50.1600.1
Microsoft SQL Server System CLR Types (x64)                                              10.50.1600.1
Microsoft System CLR Types for SQL Server 2012                                           11.1.3366.16
Microsoft System CLR Types for SQL Server 2012 (x64)                                     11.1.3366.16
Microsoft System CLR Types for SQL Server 2014                                           12.0.2000.8
Microsoft System CLR Types for SQL Server 2014                                           12.0.2000.8
Microsoft System CLR Types for SQL Server 2016                                           13.0.1601.5
Microsoft System CLR Types for SQL Server 2016                                           13.0.1601.5

C:\WINDOWS\system32>


参考 (試しに、どんなものが列挙されるのか) 冒頭のみ表示  かなり、限定的ですね。.


wmic product get vendor,name,version | findstr /v "Name        " | sort

Active Directory Authentication Library for SQL Server                                   Microsoft Corporation   13.0.1601.5
Application Insights Tools for Visual Studio 2013                                        Microsoft Corporation   2.5
AzureTools.Notifications                                                                 Microsoft Corporation   2.1.10731.1602
Behaviors SDK (Windows Phone) for Visual Studio 2013                                     Microsoft Corporation   12.0.50716.0
Behaviors SDK (Windows) for Visual Studio 2013                                           Microsoft Corporation   12.0.50429.0
Blend for Visual Studio 2013                                                             Microsoft Corporation   12.0.41002.1
Blend for Visual Studio 2013 ENU resources                                               Microsoft Corporation   12.0.41002.1
Blend for Visual Studio SDK for .NET 4.5                                                 Microsoft Corporation   3.0.40218.0
Blend for Visual Studio SDK for Silverlight 5                                            Microsoft Corporation   3.0.40218.0
Build Tools - amd64                                                                      Microsoft Corporation   12.0.40629
Build Tools - x86                                                                        Microsoft Corporation   12.0.40629
Build Tools Language Resources - amd64                                                   Microsoft Corporation   12.0.40629
Build Tools Language Resources - x86                                                     Microsoft Corporation   12.0.40629
Capture NX-D                                                                             Nikon Corporation       1.4.3
Dotfuscator and Analytics Community Edition                                              PreEmptive Solutions    5.5.4954.46574
Entity Framework 6.1.3 Tools  for Visual Studio 2013                                     Microsoft Corporation   12.0.40302.0
IIS 8.0 Express                                                                          Microsoft Corporation   8.0.1557
Kit SDK de verification de Visual Studio?2012 - fra                                      Microsoft Corporation   12.0.30501
...


参考 URL (sqlce msdn Forum en-US)

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=sqlce

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/df6ee3cc-430c-4e6a-8851-4039a05f11ef/how-to-connect-to-sql-server-compact-40-from-visual-studio-on-the-same-machine-running-windows-10?forum=sqlce


0 件のコメント:

コメントを投稿