PDA

View Full Version : Open File dialog in VBScript



Gwynbleid
06-18-2007, 04:42 AM
Hello Community,

I want to make a VBScript custom action which shows the standard OpenFile dialog. Just like this one (http://support.installshield.com/kb/view.asp?articleid=q104325), but in VBScript. It appeared to be a problem...

I found 4 ways to do this:
1) Using MSComDlg.CommonDialog object
2) Using SAFRCFileDlg.FileOpen object
3) Using UserAccounts.CommonDialog object
4) Using InternetExplorer.Application object

Unfortunately, only the last one works for all systems I tried (XP/2003/Vista). But this way also confused me most. It opens IE window and populates it with the <input type="file"> tag. I have browsed more and found that it is a kind of good practice to use IE to provide UI in VBScript. But, this appropach has limitations: it can't pass the filter to the dialog at least.

So, my question is:
Is there another way to achieve this? I need just the same behavior provided by InstallScript example mentioned above.

Thank you in advance.