I have a very simple script that is crashing on me with an error code
80004005. I am running the script on a Windows Vista machine from the my
documents folder with a standard user account

here is the code snippet

SET objShell = WScript.CREATEOBJECT("SHELL.Application")
SET objFolder = objShell.BrowseForFolder(0,"Select a File", &H4000,
strpath)

I can browse to and select the file I need, the crash occurs once the file
is selected and points to the SET objFolder line.

Thanks for any help you can provide.

Re: BrosweForFolder method erroring out by Tom

Tom
Tue May 06 10:14:13 CDT 2008

On May 6, 10:34 am, billhallsb <billhal...@discussions.microsoft.com>
wrote:
> I have a very simple script that is crashing on me with an error code
> 80004005. I am running the script on a Windows Vista machine from the my
> documents folder with a standard user account
>
> here is the code snippet
>
> SET objShell = WScript.CREATEOBJECT("SHELL.Application")
> SET objFolder = objShell.BrowseForFolder(0,"Select a File", &H4000,
> strpath)
>
> I can browse to and select the file I need, the crash occurs once the file
> is selected and points to the SET objFolder line.
>
> Thanks for any help you can provide.

As I recall, that's a capability that stopped working in
BrowseForFolder beginning with XP. Starting in XP, MS provided a
UserComdlg object that can access files, instead. See this thread for
a more in depth discussion ...

http://groups.google.com/group/microsoft.public.scripting.wsh/browse_frm/thread/2dd1b02503f89b4b/165b68656e90339e?hl=en&lnk=st&q=UserComdlg#165b68656e90339e

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

Re: BrosweForFolder method erroring out by Paul

Paul
Tue May 06 10:58:44 CDT 2008


"billhallsb" <billhallsb@discussions.microsoft.com> wrote in message
news:654F72EF-5B23-4A66-9F38-6E94ABC71AA5@microsoft.com...
>I have a very simple script that is crashing on me with an error code
> 80004005. I am running the script on a Windows Vista machine from
> the my
> documents folder with a standard user account
>
> here is the code snippet
>
> SET objShell = WScript.CREATEOBJECT("SHELL.Application")
> SET objFolder = objShell.BrowseForFolder(0,"Select a File",
> &H4000,
> strpath)
>
> I can browse to and select the file I need, the crash occurs once
> the file
> is selected and points to the SET objFolder line.
>
> Thanks for any help you can provide.

Microsoft's common dialog interface is a licensed application. It
does much more than just navigate to and open or save files and
folders. You probably have it on your system, licensed for use by the
many applications that open and save files. You probably don't have a
license to use it from scripts. Until recently, M$ had a download for
a scripted HTML editor, which included the code to automatically
obtain a free scripting license when you run the editor. Info about
it is here: http://msdn.microsoft.com/en-us/library/ms537834.aspx
The link on this web page to download the HTML editor package is
broken, but other links, such as the one for "How To Set Up Internet
Download for Comdlg32.ocx" may give you the info required to set up
and install a free single-user scripting license. As of a few years
ago, the freely downloadable Windows Platform SDK also included the
HTML editor package.

-Paul Randall