Re: Problem : BrowseForFolder returns "The system cannot find the file specified"
"R.Wieser" <[email protected]> Tue, 16 Dec 2025 14:26:30 +0100
| Newsgroups | alt.comp.lang.vbscript,alt.comp.os.windows-xp,alt.windows7.general |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
Paul,
> When presented with your code, CoPilot sez:
>
> This code selects a folder.
>
> Set shell = CreateObject("Shell.Application")
> Set folder = shell.BrowseForFolder(0, "Choose a folder:", &H4000, "c:\")
Than its hallucinating. The &H4000 means "The browse dialog box displays
files as well as folders.". Which it does.
> This code selects a file. We'll see in a moment, what the Copilot is up
> to.
>
> Set dialog = CreateObject("UserAccounts.CommonDialog")
> dialog.Filter = "All Files|*.*"
> dialog.FilterIndex = 1
> dialog.InitialDir = "C:\"
> dialog.ShowOpen
Damn. Before posting I googed for a VBScript file-selection copability, and
did not see that one come by. :-\
But, I just tested if it would work for me, and it does. So, thank you. :-)
I have to say, I didn't even know about the existance of that "UserAccounts"
object. Something to look into (new stuff and all that).
Regards,
Rudy Wieser