Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

File System Object - How to encode path with spaces

Posted on 2004-03-24
13
Medium Priority
?
792 Views
Last Modified: 2006-11-17
This should hopefully be easy...

If I use the following:

Set folder = fso.GetFolder("C:\Test\")

There are no problems, however if I change the directory to the following:

Set folder = fso.GetFolder("C:\Documents and Settings\Bill\My Documents\My Pictures\")

I get a "path not found error" or more specifically:
Microsoft VBScript runtime (0x800A004C)
Path not found
/alpha/UploadFromFolder.asp, line 110

I'm thinking it has something to do with the spaces in the filename since this is really the only difference (besides length).  Does anyone have any suggestions?

Thanks!
0
Comment
Question by:willy6743
  • 5
  • 2
  • 2
  • +3
13 Comments
 

Author Comment

by:willy6743
ID: 10673697
Looking at this a little further, I found that the path works up to the following point:

Set folder = fso.GetFolder("C:\Documents and Settings\Bill\")

However it is after I try to go another level deeper, I run into the problems.  Is this a security issue?  And if so, how can I get around it so that I can point to the 'My Pictures' folder?

Thanks!
0
 
LVL 4

Expert Comment

by:AsbjornG
ID: 10674012
Try this, it's the way windows would want you to write it:


Set folder = fso.GetFolder("""C:\Documents and Settings\Bill\My Documents\My Pictures\""")

Cheers,

Asbjorn
0
 

Author Comment

by:willy6743
ID: 10674378
I gave that a try and got the same error message.  It didn't seem to mind the extra quotes but it also did not accept them.

Thanks.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Expert Comment

by:xiong8086
ID: 10674641
use SERVER.URLENCODE("")

Set folder = fso.GetFolder(SERVER.URLENCODE("C:\Documents and Settings\Bill\My Documents\My Pictures\")),

;-)
0
 
LVL 4

Expert Comment

by:AsbjornG
ID: 10674704
How about this? (My local setup is bugged, so I'm afraid I can't test myself at the moment)

dim strDir

strDir = "C:\Documents and Settings\Bill\My Documents\My Pictures\"

Set folder = fso.GetFolder(strDir)

Asbjorn
0
 
LVL 6

Accepted Solution

by:
BAlexandrov earned 200 total points
ID: 10675027
Yes, it is permissions issue of course! To profile for every user by default have access only this user (and administrators)
Set correct permissions on folder and it will work. You will have to add IUser*** user (or Guests group) to have read or write access or choose different directory.

Bojidar Alexandrov
0
 
LVL 7

Expert Comment

by:TheKenman
ID: 10675852
Set folder = fso.GetFolder("C:\Documents%20and%20Settings\Bill\My%20Documents\My%20Pictures\")
0
 
LVL 6

Expert Comment

by:pillbug22
ID: 10677295
I would agree with BAlexandrov.  It is probably a security issue, especially if your web page is running under the default IUSER account (whihc woudn't have access to those foldes unless you specify so).

If you are using Basic or Windows Integrated login, you'll have to make sure the user has access as well.
0
 

Author Comment

by:willy6743
ID: 10678299
I will be unable to test until tonight, but I believe you are right with the security issue.  

Is there any way to run a certain page as a user other than IUSER?

I will try setting the IUSER security to this account.  Also, does anyone know of a fast way to change the security settings for a folder without actually going to the properties of the folder and doing this all manually?  Maybe by using a reg file with the registry or with command line commands (maybe a .bat file)?  I was thinking that I would like to have something in the future that will automatically set all of the properties of folders that I am concerned with at once.

I'll reply this evening on what I find out.  Thanks for all of the suggestions!
0
 
LVL 6

Expert Comment

by:pillbug22
ID: 10678395
* Is there any way to run a certain page as a user other than IUSER?

If you need anonymous connections available, you can go into IIS and change the user account for the connections (change it from IUSER to another user account).

If you are on an intranet site, you could try using Windows Integrated Login, which passes through the credentials of the user currently viewing the page. (Also true if you use Basic Authentication).


* Also, does anyone know of a fast way to change the security settings for a folder without actually going to the properties of the folder and doing this all manually?

This is possible by using some Windows Scripts, but I think that would probably be best suited for another question (integretiy of EE PAQs)
0
 

Author Comment

by:willy6743
ID: 10678861
Great info...Thanks!  And I will post elsewhere for the folder permissions question.
0
 
LVL 6

Expert Comment

by:BAlexandrov
ID: 10679529
* Is there any way to run a certain page as a user other than IUSER?
in addition
If you disable anonimous access and enable Basic Authentication and/or Windows Integrated auth you will be asked to authenticate befoer going to page and script will work with your account.

* Also, does anyone know of a fast way to change the security settings for a folder without actually going to the properties of the folder and doing this all manually?
Only will mention that command line utility for that is called "cacls'
0
 

Author Comment

by:willy6743
ID: 10680122
Thanks BAlexandrov and pillbug22 for the info.  I'm sure this is the problem so I have accepted BAlexandrov's answer before spending the time to test it.

Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question