Thursday, February 02, 2006

Query Index Service


Option Explicit
Dim objShell
Dim command,srchWord,fileType,strToCopy
Set objShell = CreateObject("WScript.Shell")
command = "mmc %windir%\system32\ciadv.msc"
'advanced query sample = @all keyboard & (@filename = *.url)
srchWord = askme("Enter search word","Search For...")
fileType = askme("Enter file type" & dbbl & "Example: *.vbs","File Type...")
strToCopy = "@all " & srchWord & " & (@filename = " & fileType & ")"
copyToClipboard(strToCopy)
shellRun command,Null

'******************************************************************************
Sub copyToClipboard(vartext)
Dim objIE
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text", vartext
objIE.Quit
End Sub
'*******************************************************************|

'******************************************************************************
Function shellRun(cmd,path)
objShell.Run cmd,3,False
End Function
'*******************************************************************|

'******************************************************************************
Function askMe(x,y)
askMe = InputBox(x,y)
End Function
'*******************************************************************|

'******************************************************************************
Function quoteMe(x)
quoteMe = Chr(34) & x & Chr(34)
End Function
'*******************************************************************|

'******************************************************************************
Function dbbl
dbbl = vbCr & vbCr
End Function
'*******************************************************************|

'*******************************************************
Sub quitscript
MsgBox "Quitting Now"
Wscript.Quit
End Sub
'*********************************************|

No comments:

Post a Comment