Microsoft社謹製Windows SearchのコマンドラインツールはGitHubにありました!


Windows 10の検索の問題


このSQLを投げるツールのソースコードがなんと GitHub に置いてありました!

Windows-classic-samples/WSSQL.cs at master · Microsoft/Windows-classic-samples

// This sample shows how to use OLEDB to talk to Windows Search


実行ファイルのコンパイルにはVisual Studioは必要ありません。素のWindows10で可能です。僕はCygwinで以下のように実行しました。

/c/c/tmp$ /c/c/Windows/Microsoft.NET/Framework64/v4.0.30319/csc WSSQL.cs
Microsoft (R) Visual C# Compiler version 4.7.2046.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5,...
WSSQL.cs(20,28): warning CS0618: 'System.Security.Permissions.SecurityAction.RequestMinimum' は古い形式です: 'Assembly l...


/c/c/tmp$ ./WSSQL.exe
wssql <SQL query> [<Chapter Depth>]

<SQL query> will be sent to Windows Search and results returned.
    Example queries:
      SELECT System.ItemName FROM SystemIndex
      SELECT System.ItemName FROM SystemIndex
        WHERE contains(*, 'dance*') AND System.Kind = 'email'
      GROUP ON System.Kind AGGREGATE Count()
        OVER (SELECT System.Kind, System.ItemName from SystemIndex)

<Chapter Depth>
    Recursion depth when expanding chapters for GROUP ON queries.
    0 = stop at first chapter, 1 = stop at second chapter, etc.
    By default all chapters are expanded.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s