Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
932 B

  1. Set Conn = Wscript.CreateObject("ADODB.Connection")
  2. Conn.ConnectionString = "provider=msidxs;"
  3. Conn.Open
  4. Set AdoCommand = Wscript.CreateObject("ADODB.Command")
  5. set AdoCommand.ActiveConnection = Conn
  6. SQLText = "SELECT path "
  7. SQLText = SQLText & "FROM scope('shallow traversal of ""C:\tests""','deep traversal of ""C:\winnt50\system32""') "
  8. SQLText = SQLText & "WHERE filename like '%.vbs' "
  9. SQLText = SQLText & "ORDER BY filename "
  10. AdoCommand.CommandText = SQLText
  11. WScript.Echo "SQL command = " & AdoCommand.CommandText
  12. Set RS = Wscript.CreateObject("ADODB.RecordSet")
  13. AdoCommand.Properties("Bookmarkable") = True
  14. RS.CursorType = adOpenKeyset
  15. RS.MaxRecords = 300
  16. RS.open AdoCommand
  17. CiSearchString = CStr(RS.Properties("Query Restriction"))
  18. For i = 0 to RS.Fields.Count - 1
  19. Wscript.Echo RS(i).Name
  20. Next
  21. Do While Not RS.EOF
  22. For i = 0 to RS.Fields.Count - 1
  23. Wscript.Echo RS(i)
  24. Next
  25. RS.MoveNext
  26. Loop
  27. RS.Close
  28. Conn.Close