Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Select multiple files in dialog box

590 views
Skip to first unread message

Reventlov

unread,
Aug 8, 2008, 4:52:59 PM8/8/08
to
Hello,
as the drag&drop method has a limit in the number of characters that can be passed as
arguments to a script, I am trying to open a dialog box and ask the user the name of the
files to be renamed.

I tried the open dialog box ("MSComDlg.CommonDialog.1"), but it doesn't work because on a
pc I don't have installed visual studio or any other program that supports the com object.

I'm trying to use IE to display the file-open box <INPUT TYPE="FILE">, but it only allows
one file to be selected.

Is there a way to ask the user for multiple existing files?

Thank you.
Giovanni.
--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--

Pegasus (MVP)

unread,
Aug 8, 2008, 5:19:20 PM8/8/08
to

"Reventlov" <no...@no.void> wrote in message
news:489af420....@powernews.libero.it...

Have a look here:
How Can I Show Users a Dialog Box for Selecting Files?
http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar05/hey0301.mspx


Reventlov

unread,
Aug 8, 2008, 5:59:28 PM8/8/08
to
Il giorno Fri, 8 Aug 2008 23:19:20 +0200, "Pegasus \(MVP\)" <I....@fly.com.oz> ha scritto:

>
>"Reventlov" <no...@no.void> wrote in message

>> Is there a way to ask the user for multiple existing files?
>

>Have a look here:
>How Can I Show Users a Dialog Box for Selecting Files?
>http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar05/hey0301.mspx
>

Thanks a lot.
I ignored the existence of UserAccounts. The syntax is similar to msComDlg (but it is
InitialDir instead of InitDir). I will try other flags to see if I can show the window in
win95 style.

Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "VBScript Scripts|*.vbs|All Files|*.*"
objDialog.Flags = &H0200
objDialog.FilterIndex = 1
objDialog.InitialDir = "C:\Scripts"
intResult = objDialog.ShowOpen

If intResult = 0 Then
Wscript.Quit
Else
Wscript.Echo objDialog.FileName
End If

0 new messages