'=================================================================================================== 'Simple IMDB Movie Lookup WSH script for Windows. 'Version 0.92 'Created by: Goran Tornqvist. 'This script is freeware, do what you like with it ;) ' 'Setup: 'Create a file with Notepad and call it IMDBMovieLookup.vbs and put all the code here in that file. 'Place the file in your profiles SendTo folder: 'C:\Documents and Settings\\SendTo 'Run the script by right-clocking a folder or file and choose SendTo -> IMDBMovieLookup.vbs '=================================================================================================== 'Path to Internet Explorer and the URL on IMDB that does the search. You may need to change this if it doesn't work. Const strBaseCommand = "e:\Progra~1\Intern~1\iexplore.exe http://us.imdb.com/Find?for=" 'Should you get a dialog box where you can edit the search string before the search is done? Const blnModeShowEditBox = False 'Run Main funktionen Main Sub Main strPath = WScript.Arguments(0) intLastSlash = InStrRev(strPath, "\") strDir = Mid(strPath, intLastSlash+1) strDir = IMDBFormat(strDir) If blnModeShowEditBox Then strDir = InputBox("Edit the search string and then click OK" & vbCrLf,"IMDB Movie Lookup",strDir) End If If strDir <> "" Then strCommand = strBaseCommand & strDir Run strCommand End If End Sub 'This function formats the search string, change it if you like. Function IMDBFormat(strDir) ArrRemoveWords = Array( _ "DVDRip","720p","1080p","1080i","BluRay","PROPER","x264","HDTV","HDDVD","UNRATED","REPACK","LIMITED","DTS","xvid","divx","mkv","avi","mpg","mp4", _ "1999","2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010", _ "SiNNERS","SEPTiC","REFiNED","HALCYON","Chakra","CiNEFiLE","METiS","iNFAMOUS" _ ) strDir = Replace(strDir,"."," ") strDir = Replace(strDir,"-"," ") For i = 0 To UBound(ArrRemoveWords) strDir = Replace(LCase(strDir), LCase(ArrRemoveWords(i)), "") Next IMDBFormat = strDir End Function 'Functions for executing external programs Function Run (ByVal cmd) Dim sh: Set sh = CreateObject("WScript.Shell") Dim wsx: Set wsx = Sh.Exec(cmd) If wsx.ProcessID = 0 And wsx.Status = 1 Then ' (The Win98 version of VBScript does not detect WshShell.Exec errors) Err.Raise vbObjectError,,"WshShell.Exec failed." End If Do Dim Status: Status = wsx.Status WScript.StdOut.Write wsx.StdOut.ReadAll() WScript.StdErr.Write wsx.StdErr.ReadAll() If Status <> 0 Then Exit Do WScript.Sleep 10 Loop Run = wsx.ExitCode End Function