﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>[Updated] File browser/ "Open" dialog in HTA</title><link>http://www.visualbasicscript.com/</link><description /><copyright>(c) VBScript Forum</copyright><ttl>30</ttl><item><title> RE: [Updated] File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  TNO, what do you mean exactely by "recreate the Common.Dialog box "? &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Reproducing the "open" dialog box graphicaly in generated html code, could be a heavy duty operation, not as fast as my script. If that's what you mean. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  For JS is a difficult&amp;nbsp;language,... all these braces floating alone in the middle of the page... you know... ;) &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Did the indents helped? just curious... &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=40215</link><pubDate>Wed, 29 Nov 2006 16:30:15 GMT</pubDate></item><item><title> RE: [Updated] File browser/ "Open" dialog in HTA (TNO)</title><description>  I actually wanted to recreate the Common.Dialog box thats available only in Win XP, and I wanted to see if I could use your implementation as a basis to start from. Since I can eat sleep and breath JS a thousand times better than vbs, I figured why not translate it while I peruse it? It be much more intuitive for me to read and alter the code in my first language, not to mention I make it a habit not to mix languages anymore. &lt;br&gt;   &lt;br&gt;   &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=40173</link><pubDate>Wed, 29 Nov 2006 08:14:46 GMT</pubDate></item><item><title> RE: [Updated] File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  TNO, &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Here is the code in a txt file with indents! If it can help. &lt;img src="http://www.visualbasicscript.com/upfiles/smiley/s3.gif" alt="" /&gt; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Why do you need to translate into JS by the way? &lt;br&gt;  &amp;nbsp; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=40161</link><pubDate>Wed, 29 Nov 2006 04:53:12 GMT</pubDate></item><item><title> RE: [Updated] File browser/ "Open" dialog in HTA (TNO)</title><description>  &lt;blockquote class="quote"&gt;&lt;i&gt;&lt;/i&gt;&lt;br&gt; (I always wonder if toher scripters are able to decyphere my scripts) &lt;/blockquote&gt; &lt;br&gt;   &lt;br&gt;  I won't lie, you don't make it easy to read&amp;nbsp;&lt;img src="http://www.visualbasicscript.com/upfiles/smiley/s6.gif" alt="" /&gt; I've been trying to translate it onto JScript for a couple days now. </description><link>http://www.visualbasicscript.com/fb.ashx?m=40066</link><pubDate>Sun, 26 Nov 2006 08:38:44 GMT</pubDate></item><item><title> RE: [Updated] File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  Added: change&amp;nbsp;cursor over selectable items. &lt;br&gt;  (thanks to TNO) &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=39965</link><pubDate>Tue, 21 Nov 2006 14:03:45 GMT</pubDate></item><item><title> RE: File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  Hi, Skie! &lt;br&gt;  &amp;nbsp; &lt;br&gt;  I'm glad you have found and fixed a bug in my script because it's a very complicated one! &lt;br&gt;  (I always wonder if toher scripters are able to decyphere my scripts) &lt;br&gt;  &amp;nbsp; &lt;br&gt;  For the C: drive issue, I think we must add some code specific&amp;nbsp;for working on&amp;nbsp;drives (instead of code specific to folders) but I don't know these codes yet. &lt;br&gt;  I can go on C: from any subfolder without error but when I launch it with C: in the arguiment, it starts in the script directory but without error. My Pc run on w98se and it may be diferent on XP. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  I won't have time to work on this next week be perhaps in two weeks... :( &lt;br&gt;  &amp;nbsp; &lt;br&gt;  &amp;nbsp; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=38247</link><pubDate>Fri, 29 Sep 2006 15:59:49 GMT</pubDate></item><item><title> RE: File browser/ "Open" dialog in HTA (Skie)</title><description>  The folder one is fixed.&amp;nbsp; I can still cause the file one by selecting a file and opening a folder with no files.&amp;nbsp; &lt;font color="#000099"&gt;document.all.fdesktopini.innerhtml = " &lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;desktop.ini&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/b&gt;"&amp;nbsp; &lt;/font&gt;Or if I go to a folder with no files, one file from the previous folder will display in the files list, but the number of files will be 0. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  I found the&amp;nbsp;fix for that issue.&amp;nbsp; You just need an ElseIf for an fCount=0. &lt;br&gt;  &lt;pre class="prettyprint"&gt;If fCount &amp;gt; 1 Then
 FileList = oMyCatString.Flush
 ElseIf fcount = 0 Then
 FileList = ""
 Else
 MyString = Mid(MyString, InStr(MyString, VbTab)+1)
 MyString = Replace(Replace(Replace(Replace(MyString, ";", "&amp;amp;nbsp;"),"*1*","&amp;lt;span id=""f"), "*2*", """&amp;gt;&amp;lt;A onclick=""SelectFile('"), "*3*", "&amp;lt;/b&amp;gt;&amp;lt;/A&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;font color=""#009933""&amp;gt;")
 FileList = MyString
 End If&lt;/pre&gt; &lt;br&gt;  &amp;nbsp; &lt;br&gt;  Only other real issue is the C: drive thing.&amp;nbsp; Doing some msgboxing, my pagefile.sys errors out on the line&amp;nbsp;Execute t.&amp;nbsp; If I do an on error resume next, it shows all the files except pagefile.sys and it duplicates the file before pagefile.sys.&amp;nbsp; Figure that might point you in the right direction for figuring out what the problem is. &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=38136</link><pubDate>Wed, 27 Sep 2006 18:26:31 GMT</pubDate></item><item><title> RE: File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  &lt;font color="#000000"&gt;Ok, I fixed it!&lt;/font&gt; &lt;br&gt;  New line of code in green... it wasn't that much! &lt;br&gt;  The code above is corrected. Tell me if it works now... &lt;br&gt;  &lt;font color="#0000ff"&gt;&lt;/font&gt;&amp;nbsp; &lt;br&gt;  &lt;font color="#0000ff"&gt;Sub DoList(fPath)&lt;/font&gt; &lt;br&gt;  &lt;font color="#00cc00"&gt;t=""&lt;/font&gt; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=38067</link><pubDate>Mon, 25 Sep 2006 14:03:53 GMT</pubDate></item><item><title> RE: File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  I have reproduced the error. I will try to corect it ASAIC. &lt;br&gt;  Thanks for reporting it. &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=38065</link><pubDate>Mon, 25 Sep 2006 13:01:56 GMT</pubDate></item><item><title> RE: File browser/ "Open" dialog in HTA (Skie)</title><description>  OS: WinXP Pro &lt;br&gt;  IE: 6.0 &lt;br&gt;  &amp;nbsp; &lt;br&gt;  With the bleeding it doesn't matter what files I'm trying to view.&amp;nbsp; It never occurs when I launch the browser, but I'm able to recreate&amp;nbsp;the bleed by doing the following.&amp;nbsp; Select at least one file, then change the folder twice by clicking on&amp;nbsp;a folder&amp;nbsp;or selecting "Up one level".&amp;nbsp; After thatn I get "MyString = ...."&amp;nbsp;before the list of folders.&amp;nbsp; If I don't select a file I can&amp;nbsp;browse through the folders as much as I want&amp;nbsp;and it works fine. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  An interesting quirk with this is if I select another file and then move to another folder.&amp;nbsp; The last file i selected will be in bold in front of the folders list.&amp;nbsp; If I browse to another folder (without selecting another file) after that, I get the "MyString=..." again.&amp;nbsp; If I hit reset and go to another folder, then the file name will be the last file in the file list. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  The bleed for the files list issue is reproducable as well.&amp;nbsp; With it I select a file and move to a folder that has no files.&amp;nbsp; It will then read "document.all.fBOOTLOGTXT.innerhtml = "&amp;nbsp;&amp;nbsp;&amp;nbsp; filename.ext&amp;nbsp;&amp;nbsp;&amp;nbsp; " where filename.ext is the last file listed in the "Files selected:" section.&amp;nbsp; Related to this problem, if I go to a folder with no filename (and didn't select a file on the previous folder) the last file listed in the previous folder will be listed as a file in that folder. &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=38019</link><pubDate>Fri, 22 Sep 2006 17:19:03 GMT</pubDate></item><item><title> RE: File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  Indeed, it doesn't work on C: drive when you launch it directly on C: as parameter, but I can lauch it from My Document and go up to C:, then it works normaly. &lt;br&gt;  I can't launch it on D: neither. I guess that for drives we need some other code as they are not folders,while &amp;nbsp;in some case can be manipulate&amp;nbsp;like a&amp;nbsp;folder. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  I don't know what to say about the "source bleeding" in the page. &lt;br&gt;  I'll need more precision about that. What files are you attempting to list? What's your OS?&amp;nbsp;IE version? &amp;nbsp;etc &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=37855</link><pubDate>Sun, 17 Sep 2006 17:51:40 GMT</pubDate></item><item><title> RE: File browser/ "Open" dialog in HTA (Skie)</title><description>  The ability to select multiple files from multiple paths is very cool.&amp;nbsp; It doesn't work&amp;nbsp;for my C: drive (C:\SubFolder works fine), but the D: drive works fine.&amp;nbsp; If I start it on the C: drive or go up a level&amp;nbsp;to the C: drive I get an error Line 1 Char 1 Invalid procedure call or argument. &lt;br&gt;  &amp;nbsp; &lt;br&gt;  I also have a problem where the code bleeds into the HTML: &lt;br&gt;  &lt;blockquote class="quote"&gt;&lt;i&gt;&lt;/i&gt;&lt;br&gt;MyString = UCase(f.name) &amp;amp; VbTab &amp;amp; "*1*" &amp;amp; Replace(Replace(Replace(Replace(f.ShortName,".","")," ",""),"~",""),"-","_") &amp;amp; "*2*" &amp;amp; f.path &amp;amp; "')""&amp;gt;&lt;b&gt;;;" &amp;amp; Replace(f.name," ","&amp;nbsp;") &amp;amp; ";;&lt;/b&gt;"&lt;/blockquote&gt; &lt;br&gt;  &lt;blockquote class="quote"&gt;&lt;i&gt;&lt;/i&gt;&lt;br&gt;document.all.fntuserini.innerhtml = " &lt;b&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ntuser.ini&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/b&gt;"&lt;/blockquote&gt; &lt;br&gt;   </description><link>http://www.visualbasicscript.com/fb.ashx?m=37841</link><pubDate>Fri, 15 Sep 2006 18:03:05 GMT</pubDate></item><item><title> [Updated] File browser/ "Open" dialog in HTA (Fredledingue)</title><description>  I needed&amp;nbsp;a&amp;nbsp;file browser&amp;nbsp;because on w98 I can't use the User object that allows using the windows "open" dialog. &lt;br&gt;  Yet I can use the IE open dialog but it doesn't allow&amp;nbsp;filtering by extention. So I had to sort of reinvent the wheel. &lt;br&gt;   &lt;br&gt;  Now the&amp;nbsp;real advantage of this HTA over the default dialog is that you can select files from different directories before submiting your selection. &lt;br&gt;   &lt;br&gt;  You don't need to hold the Ctrl key to make multiple selections, but you can't use Shift+Sparrow to select groups of files. &lt;br&gt;   &lt;br&gt;  And HTA allows you to creates your own features: &lt;br&gt;   &lt;br&gt;  -Select all, Unselect all, Reset and other buttons &lt;br&gt;  -Shows the list of&amp;nbsp;the files selected &lt;br&gt;  -Shows the number of files&amp;nbsp;in the directory after filtering &lt;br&gt;  -Separate folders from files &lt;br&gt;  -Path, extention filter, detail view and sorting argument customizable from launch script &lt;br&gt;   &lt;br&gt;  Not featuring yet: &lt;br&gt;  -Address bar &lt;br&gt;  -Buttons for changing&amp;nbsp;&amp;nbsp;extention filter, detail view and sorting argument from the HTA file browser &lt;br&gt;  -List of subfolders not sorted &lt;br&gt;   &lt;br&gt;  Use: &lt;br&gt;   &lt;br&gt;  Take the example from the script below. &lt;br&gt;   &lt;br&gt;  commandline is: &lt;br&gt;  WshShell.Run "filebrowser3.hta /[path] /[extentions separated by commas] /O:[sort by argument] /V:[view arguments]", 3, true &lt;br&gt;   &lt;br&gt;  Sort argument and view argument&amp;nbsp;are moreless the&amp;nbsp;same as in DOS: &lt;br&gt;   &lt;br&gt;  Sort by (/O:) : &lt;br&gt;  N - by name &lt;br&gt;  E - by extension&amp;nbsp; &lt;br&gt;  A - by last access date &lt;br&gt;  S - by size&amp;nbsp; &lt;br&gt;  D - by date and time &lt;br&gt;   &lt;br&gt;  View details (/V:) : &lt;br&gt;  A -&amp;nbsp; last access date &lt;br&gt;  S -&amp;nbsp; size&amp;nbsp; &lt;br&gt;  D -&amp;nbsp; date and time &lt;br&gt;  B -&amp;nbsp; attribute &lt;br&gt;  L -&amp;nbsp; full details &lt;br&gt;   &lt;br&gt;  Arguments can be written in whatever order you wish, with or without white space or be obmited without generating error. &lt;br&gt;   &lt;br&gt;  When the dialog open click on file names to select them. &lt;br&gt;  After the dialog is closed, the script will have to read the list from&amp;nbsp;"list.tmp". &lt;br&gt;   &lt;br&gt;  &lt;pre class="prettyprint"&gt;
 Title = "Testing Browse for files"
 Set fso = CreateObject("Scripting.FileSystemObject")
 Set WshShell = WScript.CreateObject("WScript.Shell")
 '--------Launch browser--------
 '---------SortBy (/O:)---------
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; N - by name 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; E - by extension 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; A - by last access date
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; S - by size 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; D - by date and time
 '------ViewDetails (info) (/V:)-------
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; A -&amp;nbsp; last access date
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; S -&amp;nbsp; size 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; D -&amp;nbsp; date and time
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; B -&amp;nbsp; attribute
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; L -&amp;nbsp; full details
 '----------
 WshShell.Run "filebrowser.hta /C:\MYDOCU~1 /txt,doc,pdf /O:N /V:SD", 3, true
 '-------Open temp file to read the list of items-----
 If fso.FileExists("list.tmp") Then
 Set f = fso.GetFile("list.tmp")
 Set ts = f.OpenAsTextStream(1)
 t = ts.ReadAll
 ts.Close
 f.Delete
 MsgBox t,,Title
 End If
 '-------end of example---------
 &lt;/pre&gt; &lt;br&gt;   &lt;br&gt;  Here is the HTA code &lt;br&gt;  Save it as "filebrowser.hta" &lt;br&gt;   &lt;br&gt;  &lt;pre class="prettyprint"&gt;&amp;lt;HTML&amp;gt;
 &amp;lt;HEAD&amp;gt;
 &amp;lt;HTA:APPLICATION ID="FileBrowser" 
 &amp;nbsp;&amp;nbsp; APPLICATIONNAME="FileBrowser"
 WINDOWSTATE="maximize"
 &amp;nbsp;&amp;nbsp; SINGLEINSTANCE="no"&amp;gt;
 &amp;lt;meta name="VI60_defaultClientScript" content="VBScript"&amp;gt;
 &amp;lt;TITLE&amp;gt;Select a file&amp;lt;/TITLE&amp;gt;
 &amp;lt;SCRIPT LANGUAGE="VBScript"&amp;gt;
 Public FolPath, fso, WshShell, InvLinkDebug, Selection, ExtFilter, SortBy, ViewDetails
 Sub window_onLoad()
 Set fso = CreateObject("scripting.FilesystemObject")
 Set WshShell = CreateObject("WScript.Shell")
 t = Split(FileBrowser.commandLine, "/")
 'MsgBox t(1) &amp;amp;vbcrlf&amp;amp; t(2) ,,"debug arguments"
 '----read arguments-----
 FolPath = ""
 SortBy = ""
 ViewDetails = ""
 ExtFilter = ","
 If UBound(t)&amp;gt;0 Then
 For i=1 To UBound(t)
 &amp;nbsp;If InStr(t(i), ":\") Then
 &amp;nbsp;FolPath = t(i)
 &amp;nbsp;ElseIf InStr(t(i), "O:") Then
 &amp;nbsp;SortBy = UCase(Replace( Mid(t(i), InStr(t(i), ":")+1) ," ",""))
 &amp;nbsp;ElseIf InStr(t(i), "V:") Then
 &amp;nbsp;ViewDetails = UCase(Replace( Mid(t(i), InStr(t(i), ":")+1) ," ",""))
 &amp;nbsp;ElseIf t(i)&amp;lt;&amp;gt;"" Then
 &amp;nbsp;ExtFilter = Replace(t(i)," ","") &amp;amp; ","
 &amp;nbsp;End If
 Next
 End If
 '---------SortBy---------
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; N - by name 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; E - by extension 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; A - by last access date
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; S - by size 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; D - by date and time
 '----
 If SortBy = "" Then
 SortBy = "N"
 End If
 '-----------------------
 If FolPath = "" Then
 FolPath = WshShell.CurrentDirectory
 End If
 '------ViewDetails (info)-------
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; A -&amp;nbsp; last access date
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; S -&amp;nbsp; size 
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; D -&amp;nbsp; date and time
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; B -&amp;nbsp; attribute
 '&amp;nbsp;&amp;nbsp;&amp;nbsp; L -&amp;nbsp; full details
 '&amp;nbsp;&amp;nbsp; ""
 '
 '-------debug--------
 'MsgBox "FolPath= " &amp;amp; FolPath _
 '&amp;nbsp;&amp;nbsp;&amp;amp;vbcrlf&amp;amp; "SortBy=" &amp;amp; SortBy _
 '&amp;nbsp;&amp;nbsp;&amp;amp;vbcrlf&amp;amp; "ViewDetails= " &amp;amp; ViewDetails _
 '&amp;nbsp;&amp;nbsp;&amp;amp;vbcrlf&amp;amp; "ExtFilter= " &amp;amp; ExtFilter ,,"debug arguments"&amp;nbsp;
 '------end debug------
 InvLinkDebug = True
 t=Null
 Call DoList(FolPath)
 End Sub
 Sub DoList(fPath)
 LinkCount = 0
 fCount = 0
 t=""
 '------------do buttons------
 TextToStart = "&amp;lt;p align=""center""&amp;gt;&amp;lt;strong&amp;gt;" &amp;amp; fPath &amp;amp; "&amp;lt;/strong&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;INPUT NAME=""BtnUpOneLevel"" TYPE=""BUTTON"" VALUE=""&amp;lt;== Up one level"" "
 If InStr(fPath, "\")=0 Then
 fPath = fPath &amp;amp; "\"
 End If
 If InStrRev(fPath, ":\") = Len(fPath)-1 Then
 TextToStart = TextToStart &amp;amp; "disabled&amp;gt;&amp;lt;/p&amp;gt;"
 Else
 TextToStart = TextToStart &amp;amp; "onclick=""DoList('" &amp;amp;&amp;nbsp;&amp;nbsp; Left(fPath, InStrRev(fPath,"\")-1)&amp;nbsp;&amp;nbsp; &amp;amp; "')""&amp;gt;&amp;lt;/p&amp;gt;"
 End If
 TextToStart = TextToStart &amp;amp; "&amp;lt;span id=""This"" onmouseover=""this.style.cursor='hand'"" onmouseout=""this.style.cursor='auto'""&amp;gt;"
 '----------do subfolders--------
 Set folder = fso.getfolder(fPath)
 For Each f in folder.subfolders
 t = t &amp;amp; "&amp;lt;A onclick=""DoList('"&amp;nbsp; &amp;amp;&amp;nbsp; f.path&amp;nbsp; &amp;amp; _
 &amp;nbsp;"')"" &amp;gt;&amp;lt;img name=""BtnOpenFolder"" src=""openfol.gif"" border=""0"" alt=""go to this directory""&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;" &amp;amp;_
 &amp;nbsp;Replace(f.name," ","&amp;amp;nbsp") &amp;amp; "&amp;lt;/A&amp;gt; &amp;amp;nbsp;&amp;amp;nbsp;"
 Next
 If t &amp;lt;&amp;gt;"" Then
 TextToStart = TextToStart &amp;amp; t
 End If
 '-------------do files---------
 '---------SortBy---------
 Select Case SortBy
 Case ""&amp;nbsp; t="MyString = UCase(f.name) &amp;amp; VbTab &amp;amp;"
 Case "N" t="MyString = UCase(f.name) &amp;amp; VbTab &amp;amp;"
 Case "E" t="MyString = fso.GetExtensionName(f.name) &amp;amp; UCase(f.name) &amp;amp; VbTab &amp;amp;"
 Case "A" t="MyDate = f.DateLastAccessed" _
 &amp;amp; VbCrlf &amp;amp; "MyString = Right(Year(MyDate),2) &amp;amp; Right( ""0"" &amp;amp; Month(MyDate),2 ) &amp;amp; Right( ""0"" &amp;amp; Day(MyDate),2 ) " _
 &amp;amp; "&amp;amp; UCase(f.name) &amp;amp; VbTab &amp;amp;"
 Case "S" t="MyString = Chr(Len(f.size)+65) &amp;amp; f.size &amp;amp; VbTab &amp;amp;"
 Case "D" t="MyDate = f.DateLastModified" _
 &amp;amp; VbCrlf &amp;amp; "MyString = Right(Year(MyDate),2) &amp;amp; Right( ""0"" &amp;amp; Month(MyDate),2 ) &amp;amp; Right( ""0"" &amp;amp; Day(MyDate),2 ) " _
 &amp;amp; " &amp;amp; Right( ""0"" &amp;amp; Hour(MyDate),2 ) &amp;amp; Right( ""0"" &amp;amp; Minute(MyDate),2 ) &amp;amp; Right( ""0"" &amp;amp; Second(MyDate),2 )" _
 &amp;amp; "&amp;amp; UCase(f.name) &amp;amp; VbTab &amp;amp;"
 End Select
 '------ViewDetails-------
 Select Case True
 Case ViewDetails="" t=t &amp;amp; " ""*1*"" &amp;amp; Replace(Replace(Replace(Replace(f.ShortName,""."",""""),"" "",""""),""~"",""""),""-"",""_"") &amp;amp; ""*2*"" &amp;amp; f.path &amp;amp; ""')""""&amp;gt;&amp;lt;b&amp;gt;;;""" _ 
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(f.name,"" "",""&amp;amp;nbsp"") &amp;amp; "";;&amp;lt;/b&amp;gt;&amp;lt;/A&amp;gt;&amp;lt;/span&amp;gt;"""
 Case InStr(ViewDetails,"L")&amp;gt;0 t=t &amp;amp; " ""*1*"" &amp;amp; Replace(Replace(Replace(Replace(f.ShortName,""."",""""),"" "",""""),""~"",""""),""-"",""_"") &amp;amp; ""*2*"" &amp;amp; f.path &amp;amp; ""')""""&amp;gt;&amp;lt;b&amp;gt;;;""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(f.name,"" "",""&amp;amp;nbsp"") &amp;amp; "";;*3*""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; FormatNumber(f.Size, 0,0,0,-1) &amp;amp; "";b, Modified: "" &amp;amp; f.DateLastModified &amp;amp; "", Accessed: "" &amp;amp; f.DateLastAccessed" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(Replace(Replace(Replace(""["" &amp;amp; f.Attributes,""1"",""Read Only""),""[2"",""[Hidden""),""4"",""System File""),""32"",""Archive"") &amp;amp; ""]&amp;lt;/font&amp;gt;&amp;lt;/A&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;"""
 Case InStr(ViewDetails,"A")&amp;gt;0 t=t &amp;amp; " ""*1*"" &amp;amp; Replace(Replace(Replace(Replace(f.ShortName,""."",""""),"" "",""""),""~"",""""),""-"",""_"") &amp;amp; ""*2*"" &amp;amp; f.path &amp;amp; ""')""""&amp;gt;&amp;lt;b&amp;gt;;;""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(f.name,"" "",""&amp;amp;nbsp"") &amp;amp; "";;*3*""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; "" Acc.: "" &amp;amp; f.DateLastAccessed"
 Case InStr(ViewDetails,"S")&amp;gt;0 t=t &amp;amp; " ""*1*"" &amp;amp; Replace(Replace(Replace(Replace(f.ShortName,""."",""""),"" "",""""),""~"",""""),""-"",""_"") &amp;amp; ""*2*"" &amp;amp; f.path &amp;amp; ""')""""&amp;gt;&amp;lt;b&amp;gt;;;""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(f.name,"" "",""&amp;amp;nbsp"") &amp;amp; "";;*3*""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; FormatNumber(f.Size, 0,0,0,-1) &amp;amp; "";b"""
 Case InStr(ViewDetails,"D")&amp;gt;0 t=t &amp;amp; " ""*1*"" &amp;amp; Replace(Replace(Replace(Replace(f.ShortName,""."",""""),"" "",""""),""~"",""""),""-"",""_"") &amp;amp; ""*2*"" &amp;amp; f.path &amp;amp; ""')""""&amp;gt;&amp;lt;b&amp;gt;;;""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(f.name,"" "",""&amp;amp;nbsp"") &amp;amp; "";;*3*""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; f.DateLastModified"
 Case InStr(ViewDetails,"B")&amp;gt;0 t=t &amp;amp; " ""*1*"" &amp;amp; Replace(Replace(Replace(Replace(f.ShortName,""."",""""),"" "",""""),""~"",""""),""-"",""_"") &amp;amp; ""*2*"" &amp;amp; f.path &amp;amp; ""')""""&amp;gt;&amp;lt;b&amp;gt;;;""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(f.name,"" "",""&amp;amp;nbsp"") &amp;amp; "";;*3*""" _
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;amp; " &amp;amp; Replace(Replace(Replace(Replace(""["" &amp;amp; f.Attributes,""1"",""Read Only""),""[2"",""[Hidden""),""4"",""System File""),""32"",""Archive"") &amp;amp; ""]"""
 End Select
 '----if more than one---
 If Len(ViewDetails)&amp;gt;1 Then
 &amp;nbsp;For i=2 To Len(ViewDetails)
 &amp;nbsp;&amp;nbsp;Select Case True
 &amp;nbsp;&amp;nbsp;Case InStr(i,ViewDetails,"A",1)&amp;gt;0 t=t &amp;amp; " &amp;amp; "";Acc.:;"" &amp;amp; f.DateLastAccessed"
 &amp;nbsp;&amp;nbsp;Case InStr(i,ViewDetails,"S",1)&amp;gt;0 t=t &amp;amp; " &amp;amp; "";-;"" &amp;amp; FormatNumber(f.Size, 0,0,0,-1) &amp;amp; "";b"""
 &amp;nbsp;&amp;nbsp;Case InStr(i,ViewDetails,"D",1)&amp;gt;0 t=t &amp;amp; " &amp;amp; "";-;"" &amp;amp; f.DateLastModified"
 &amp;nbsp;&amp;nbsp;Case InStr(i,ViewDetails,"B",1)&amp;gt;0 t=t &amp;amp; " &amp;amp; "";-;"" &amp;amp; Replace(Replace(Replace(Replace(""["" &amp;amp; f.Attributes,""1"",""Read Only""),""[2"",""[Hidden""),""4"",""System File""),""32"",""Archive"") &amp;amp; ""]"""
 &amp;nbsp;&amp;nbsp;End Select
 &amp;nbsp;Next
 End If
 If InStr(ViewDetails,"L")=0 And ViewDetails&amp;lt;&amp;gt;"" Then
 &amp;nbsp;If Len(ViewDetails)&amp;gt;2 Then
 &amp;nbsp;t=t &amp;amp; " &amp;amp; ""&amp;lt;/font&amp;gt;&amp;lt;/A&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;"""
 &amp;nbsp;Else
 &amp;nbsp;t=t &amp;amp; " &amp;amp; ""&amp;lt;/font&amp;gt;&amp;lt;/A&amp;gt;&amp;lt;/span&amp;gt;"""
 &amp;nbsp;End If
 End If
 '-------------
 Set oMyCatString = New AddString '---utilise la classe pour ajouter les ficheirs dans la liste rapidement
 For Each f in folder.files
 &amp;nbsp;If ExtFilter = "," Or InStr(1, ExtFilter,&amp;nbsp; fso.GetExtensionName(f.name) &amp;amp; ",", 1) Then
 &amp;nbsp;Execute t
 &amp;nbsp;oMyCatString MyString
 &amp;nbsp;fCount = fCount+1
 &amp;nbsp;End If
 Next
 If fCount &amp;gt; 1 Then
 FileList = oMyCatString.Flush
 ElseIf fcount = 0 Then
 FileList = ""
 Else
 MyString = Mid(MyString, InStr(MyString, VbTab)+1)
 MyString = Replace(Replace(Replace(Replace(MyString, ";",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;amp;nbsp;"),"*1*","&amp;lt;span id=""f"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ), "*2*",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """&amp;gt;&amp;lt;A onclick=""SelectFile('"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ), "*3*", "&amp;lt;/b&amp;gt;&amp;lt;font color=""#009933""&amp;gt;")
 FileList = MyString
 End If
 document.all.ListOfItems.innerhtml =&amp;nbsp; TextToStart &amp;amp; "&amp;lt;hr&amp;gt;" &amp;amp; FileList &amp;amp; "&amp;lt;/p&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;p&amp;gt;&amp;lt;font color=""#FF0000""&amp;gt;Number of files: " &amp;amp; fCount &amp;amp; "&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;"
 End Sub
 
 '-----class to concatenate strings (modified)-----
 Class AddString
 Dim iElement, NewStrArray
 Private Sub Class_Initialize()
 iElement = 0
 ReDim NewStrArray(iElement)
 End Sub
 Public Default Sub AddString(Value)
 NewStrArray(iElement) = Value
 iElement = iElement + 1
 ReDim Preserve NewStrArray(iElement)
 End Sub
 Public Function Flush
 iElement = iElement - 1
 Redim Preserve NewStrArray(iElement)
 '------sort list-----
 ArraySort NewStrArray
 '-----remove sorting mark------
 '-----and add html code that where replaced by "*1*" to make string shorter when sorting-----
 For iel = 0 To&amp;nbsp; UBound(NewStrArray)
 Word = NewStrArray(iel)
 Word = Mid(Word, InStr(Word, VbTab)+1)
 Word = Replace(Replace(Replace(Replace(Word, ";", "&amp;amp;nbsp;"),"*1*","&amp;lt;span id=""f"), "*2*", """&amp;gt;&amp;lt;A onclick=""SelectFile('"), "*3*", "&amp;lt;/b&amp;gt;&amp;lt;font color=""#009933""&amp;gt;")
 NewStrArray(iel) = Word
 Next
 '--------------------
 Flush = Join(NewStrArray,VbCrLf)
 End Function
 '-----------sort function---------
 Private Function ArraySort(ArrY)
 ReDim TempArray(255)
 For Each Word in ArrY
 UCaseWord = UCase(Word) &amp;amp; "&amp;nbsp;&amp;nbsp; "
 TempArrayNum = Asc(Left(UCaseWord,1))
 TempArray(TempArrayNum) = TempArray(TempArrayNum) &amp;amp; Word &amp;amp; VBCrlf 
 Next
 For Each SmallList In TempArray
 &amp;nbsp;If SmallList &amp;lt;&amp;gt;"" Then
 &amp;nbsp;SmallArray = Split( Mid(SmallList,2 ),VBCrlf)
 &amp;nbsp;'-----------------
 &amp;nbsp;InsertionSort SmallArray
 &amp;nbsp;'------------------
 &amp;nbsp;BigList = BigList &amp;amp; Join(SmallArray,VbCrlf)
 &amp;nbsp;End If
 Next
 time2 = Timer
 ArrY = Split(BigList,VbCrlf)
 Erase SmallArray
 Erase TempArray
 End Function
 '-----------sort function---------
 Private Function InsertionSort(arrX)
 &amp;nbsp; Dim nUB : nUB = UBound(arrX)
 &amp;nbsp; Dim i, j, v
 &amp;nbsp; For i=1 To nUB
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=arrX(i)
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j=i
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While arrX(j-1) &amp;gt; v
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arrX(j) = arrX(j-1)
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j=j-1
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If j&amp;lt;=0 Then
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Do
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arrX(j) = v
 &amp;nbsp; Next
 End Function
 '------------------------------------
 Private Sub Class_Terminate()
 Erase NewStrArray
 End Sub
 End Class
 '--------
 
 Sub SelectFile(fPath)
 fName = fso.GetFile(fPath).ShortName
 fName = "f" &amp;amp;&amp;nbsp; Replace(Replace(Replace(Replace(fName,".",""),"~","")," ",""),"-","_")
 Execute "t = document.all." &amp;amp; fName &amp;amp; ".innerhtml"
 If InStr(t,"#ffffff") Then
 Selection = Replace(Selection, fPath &amp;amp; VbCrlf,"")
 t = Mid(t, 55)
 t = Left(t, Len(t)-7)
 MyString = "document.all." _
 &amp;nbsp;&amp;amp; fName _
 &amp;nbsp;&amp;amp; ".innerhtml =""" _
 &amp;nbsp;&amp;amp; Replace(Replace(t,"""",""""""),VbCrlf,"") _
 &amp;nbsp;&amp;amp; """"
 Else
 Selection = Selection &amp;amp; fPath &amp;amp; VbCrlf
 MyString = "document.all." _
 &amp;nbsp;&amp;amp; fName _
 &amp;nbsp;&amp;amp; ".innerhtml = ""&amp;lt;font color=""""#ffffff""""&amp;nbsp; style=""""background-color: #0000ff""""&amp;gt;&amp;nbsp;&amp;nbsp; " _
 &amp;nbsp;&amp;amp; Replace(Replace(t,"""",""""""),VbCrlf,"") _
 &amp;nbsp;&amp;amp; "&amp;lt;/font&amp;gt;"""
 End If
 Execute MyString
 document.all.ListOfSelectedItems.innerhtml = Replace(Selection, VbCrlf,"&amp;lt;br&amp;gt;")
 End Sub
 Sub ResetSelection
 Selection = ""
 For each span in document.all.tags("span")
 SpanID = span.id
 If Left(SpanID,1) = "f" Then
 t = span.innerhtml
 &amp;nbsp;If InStr(t,"#ffffff") Then
 &amp;nbsp;t = Mid(t, 55)
 &amp;nbsp;t = Left(t, Len(t)-7)
 &amp;nbsp;span.innerhtml = t
 &amp;nbsp;End If
 End If
 Next
 document.all.ListOfSelectedItems.innerhtml = ""
 End Sub
 
 Sub UnSelectAll
 For each span in document.all.tags("span")
 SpanID = span.id
 If Left(SpanID,1) = "f" Then
 t = span.innerhtml
 &amp;nbsp;If InStr(t,"#ffffff") Then
 &amp;nbsp;fPath = Mid(t,&amp;nbsp;&amp;nbsp; InStr(t,"SelectFile('")+12)
 &amp;nbsp;fPath = Left(fPath,&amp;nbsp; InStr(fPath,"'")-1)
 &amp;nbsp;Selection = Replace(Selection, fPath &amp;amp; VbCrlf,"")
 &amp;nbsp;t = Mid(t, 55)
 &amp;nbsp;t = Left(t, Len(t)-7)
 &amp;nbsp;span.innerhtml = t
 &amp;nbsp;End If
 End If
 Next
 document.all.ListOfSelectedItems.innerhtml = Replace(Selection, VbCrlf,"&amp;lt;br&amp;gt;")
 End Sub
 Sub SelectAll
 For each span in document.all.tags("span")
 SpanID = span.id
 If Left(SpanID,1) = "f" Then
 t = span.innerhtml
 &amp;nbsp;If InStr(t,"#ffffff")=0 Then
 &amp;nbsp;fPath = Mid(t,&amp;nbsp;&amp;nbsp; InStr(t,"SelectFile('")+12)
 &amp;nbsp;fPath = Left(fPath,&amp;nbsp; InStr(fPath,"'")-1)
 &amp;nbsp;Selection = Selection &amp;amp; fPath &amp;amp; VbCrlf
 &amp;nbsp;t = "&amp;lt;font color=""#ffffff""&amp;nbsp; style=""background-color: #0000ff""&amp;gt;&amp;nbsp;&amp;nbsp; " &amp;amp; t &amp;amp; "&amp;lt;/font&amp;gt;"
 &amp;nbsp;span.innerhtml = t
 &amp;nbsp;End If
 End If
 Next
 document.all.ListOfSelectedItems.innerhtml = Replace(Selection, VbCrlf,"&amp;lt;br&amp;gt;")
 End Sub
 Sub WriteList
 Set objOutputFile = fso.CreateTextFile("list.tmp", True)
 objOutputFile.WriteLine Selection
 objOutputFile.Close
 Window.Close
 Wscript.Quit(1)
 End Sub
 Sub CancelSelection
 Window.Close
 Wscript.Quit
 End Sub
 &amp;lt;/SCRIPT&amp;gt;
 &amp;lt;/HEAD&amp;gt;
 &amp;lt;BODY bgcolor="#FCF3DA"&amp;gt;
 &amp;lt;FORM NAME="form"&amp;gt;
 &amp;lt;INPUT NAME="BtnOpenSelection" ONCLICK="WriteList" TYPE="BUTTON" VALUE="Open selection"&amp;gt;
 &amp;lt;INPUT NAME="BtnSelectAll" ONCLICK="SelectAll" TYPE="BUTTON" VALUE="Select All"&amp;gt;
 &amp;lt;INPUT NAME="BtnUnSelectAll" ONCLICK="UnSelectAll" TYPE="BUTTON" VALUE="UnSelect All"&amp;gt;
 &amp;lt;INPUT NAME="BtnReset" ONCLICK="ResetSelection" TYPE="BUTTON" VALUE="Reset"&amp;gt;
 &amp;lt;INPUT NAME="BtnCancel" ONCLICK="CancelSelection" TYPE="BUTTON" VALUE="Cancel"&amp;gt;
 &amp;lt;span id="ListOfItems"&amp;gt;&amp;lt;/span&amp;gt;
 &amp;lt;hr&amp;gt;
 &amp;lt;font color="#FF0000"&amp;gt;Files selected:&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;
 &amp;lt;span id="ListOfSelectedItems"&amp;gt;&amp;lt;/span&amp;gt;
 &amp;lt;/FORM&amp;gt;
 &amp;lt;/BODY&amp;gt;
 &amp;lt;!--Free to use and distribute for private and non commercial and non professional purpose. 
 This hta application is under copyright protection." --&amp;gt;
 &amp;lt;/HTML&amp;gt;
 &lt;/pre&gt; </description><link>http://www.visualbasicscript.com/fb.ashx?m=36250</link><pubDate>Mon, 17 Jul 2006 06:58:08 GMT</pubDate></item></channel></rss>
