Link to home
Start Free TrialLog in
Avatar of bigtwig
bigtwig

asked on

ASP FSO.GetFolder(path) returns Path Not Found - Microsoft VBScript runtime (0x800A004C)

Hi,
This used to work but now it's now.
I get a Path Not Found, Microsoft VBScript runtime (0x800A004C)

Code Snippet is attached.
The Response.Write() returns this:
Len:119
Pos:93
File:C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Settings\VWD Express\

The error occurs at this line:
Set updfolder = fs2.GetFolder(newupdstrFile)

Thanks (and have a Blessed Easter!),
Mike
updlength=len(updstrFile)
updpos=InStrRev(updstrFile,"\")
newupdstrFile=Left(updstrFile,updpos)
 
response.write("Len:"&updlength)
response.write("Pos:"&updpos)
response.write("File:"&newupdstrFile)
 
Set fs2 = Server.CreateObject("Scripting.FileSystemObject")
if newupdstrFile<>"" then
   Set updfolder = fs2.GetFolder(newupdstrFile)
end if

Open in new window

Avatar of hielo
hielo
Flag of Wallis and Futuna image

Try excluding the last slash so that instead of:
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Settings\VWD Express\
you are passing:
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Settings\VWD Express
Of course, you also need to make sure the folder actually exists.
Avatar of bigtwig
bigtwig

ASKER

@hielo:
The folder exists.  I can copy/paste everthing after the "File:" from the above Response.Write into the IE Address Bar or Windows Explorer and it pulls it up fine.

I tried removing the trailing slash and still get the same message:
Microsoft VBScript runtime (0x800A004C)
Path not found
ASKER CERTIFIED SOLUTION
Avatar of Member_2_3718378
Member_2_3718378

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, and remove the following line -- it was in there just to give that variable a value.
Const updstrFile = "C:\Program Files\Media Player Classic\mplayer.exe"

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bigtwig

ASKER

OK, add this to the mix...

When I try C:\COMPAQ, I get this:
updstrfile:C:\COMPAQ\Readme.txt
Len:20
Pos:10
File:C:\COMPAQ\

When I try C:\COMPAQ\DotNet, I get the error... (Path Not Found)
updstrfile:C:\COMPAQ\DotNet\EULA.TXT
Len:25
Pos:17
File:C:\COMPAQ\DotNet\

Everything online points to a permissions error, but I shouldn't get this on my local machine?
Avatar of bigtwig

ASKER

@deathtospam:
I had to change your source file to: updstrFile = "C:\Program Files\Windows Media Player\WMPLayer.exe", but what you did worked.
Here's the output:
Len: 50
Pos: 38
Folder: C:\Program Files\Windows Media Player\
The folder C:\Program Files\Windows Media Player\ exists.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bigtwig

ASKER

Using deathtospam's code got rid of the error, but per line 17 of his Code Snippet, I still get:
The folder C:\COMPAQ\DotNet\ does not exist.

This folder clearly does exist on my local machine.  I can copy that link into Windows Explorer or my IE7 Address Bar and it pulls it right up.

More thoughts?
Thanks,
Mike
Avatar of bigtwig

ASKER

I don't know, guys.  You've all given me good information.  I still get the error in some directories, even local, and don't get the error in others.  It's got to be some sort of permission error.  The code you've given to me is all functional and helps.  Thanks for all of your efforts!