Hackoo Posted March 8, 2011 Share Posted March 8, 2011 Hi This VBScript Scan and Search for images with extension like jpg ,gif,png,bmp in the folder and subfolders and list them in a html output file 'This VBScript Scan and Search for images with extension like jpg,gif,png,bmp 'in the folder and subfolders and list them in a html output file.'© Hackoo © 2011start_folder = ".\" ' The Current Directory for scaning imageshtmfile = "ListImage.htm"ext = Array("jpg","gif","png","bmp")Signature = "<br><center><font size=10 FACE=Comic sans MS style=font-weight:bold Color=red>©<br><img src=http://photomaniak.com/upload/out.php/i1102064_IDNlogo.gif>" count=0Set fso = CreateObject("Scripting.FileSystemObject")Set folder = fso.GetFolder(start_folder)Set ws = CreateObject("WScript.Shell")Set outfile = fso.CreateTextFile(htmfile)outfile.WriteLine "<html><body>"ListDirectory folder, ext 'Call The Recursive functionoutfile.WriteLine "<br><center><font color=red>Le Nombre total des images est de "& count & "</font>"outfile.WriteLine Signatureoutfile.WriteLine "</body></html>"outfile.CloseQuestion = MsgBox("The Total Count of images is " & count & vbCrLf &" Do you want to List them now ?",vbYesNo+32,"Total Count of images")If Question = vbYes ThenExplorer htmfileelsewscript.QuitEnd IfSub ListDirectory(folder, ext) For Each file In folder.Files cheminFic = folder & "\" & file.name For i = lbound(ext) to ubound(ext) If UCase(ext(i)) = UCase(fso.GetExtensionName(file.Name)) Then strFilePath = file.ParentFolder outfile.WriteLine "<center><a target=_Blank href="& qq(cheminFic) &">"&_ "<img src= "& qq(cheminFic) &" width=80% height=100%><BR><B><font color=red>"&_ "<a href='" & strFilePath & "'>The Location of " & file.Name & "</a></font><B><br><hr>" count=count+1 End If Next Next For Each fldr In folder.subfolders ListDirectory fldr, ext NextEnd SubFunction Explorer(File)Set ws=CreateObject("wscript.shell")ws.run "Explorer "& File & "\"end FunctionFunction qq(strIn) qq = Chr(34) & strIn & Chr(34)End Function[/CODE] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.