how to specify network path in getFolder - FSO in ASP

Hello Guys,

Could someone of you please let me know how should I be able to specify path of the different machine mapped on the network in the following line ...

set theFolder = fso.getFolder("R:\\data\users")

where R here is the drive the machine with the IP(10.233.323.26) mapped to.

have tried with the ip but no luck ...
your advice/suggestion is much appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Have you tried NOT supplying the drive, and use the machine name instead:
set theFolder = fso.getFolder("\\machinename\data\users")
or perhaps:
set theFolder = fso.getFolder("\\10.233.323.26\data\users")
b0lsc0ttIT ManagerCommented:

If it is mapped to the R drive then what you had is real close.  You use ...

set theFolder = fso.getFolder("R:\data\users")

If you still have a problem then are you sure the IUSR account has access to the drive and share?

Hielo may correct me but I believe UNC paths (i.e. machine name or IP) won't work for the full physical path getFolder and other methods need.  I may be confusing that with another part of ASP though. :)

Let me know if you have any questions or need more information.

niidmoreAuthor Commented:
hello guys,
thanks for your replies. have tried with machine name, ipaddress, and the drive name, none works.
yes i do have access to the drive and the  read/write permissions .
can you think of anything else please?
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

If you type:
on explorer, can you get to the files? Not sure but you may actually have to specify the full path. Ex:
assuming there exists:
Hi, if you are executing this code via an ASP page, you may be having permissions issues with the security context of the user using the session.  What are the permissions on your share you want to map to?  Is the IUSR_<SERVER> account listed?


niidmoreAuthor Commented:
guess i better copy all the files to my local PC, edit and write it back to the destination folder .... as this is a one off extract i better dont get into more details .... thanks all for your comments !
however, i am having another problem now, if you could please have a look to the attached script, it should write all the files back to the temp folder instead its just created one single file named ".xml"
not all the files has the content in it, in which it should add a single node <nodeName/>

Dim xmlSource, fso, file, uname
Set xmlSource   = Server.CreateObject("MSXML2.DOMDocument")
Set fso         = Server.CreateObject("Scripting.FileSystemObject")
set theFolder = fso.getFolder("E:\users")
for Each f In theFolder.files      
      If xmlSource.load("E:\users\" & Then           
            userName        = xmlSource.documentElement.selectSingleNode("UserName").text    
            groupName       = xmlSource.documentElement.selectSingleNode("GroupName").text          
            excludeUser     = xmlSource.documentElement.selectSingleNode("ExcludeUser").text            
            savedSearches   = xmlSource.documentElement.selectSingleNode("_SavedSearches").text
            userPreferences = xmlSource.documentElement.selectSingleNode("_Preferences").text
            dataAccess      = xmlSource.documentElement.selectSingleNode("DataAccess").text
            pageLength      = xmlSource.documentElement.selectSingleNode("_PageLength").text
            sortField       = xmlSource.documentElement.selectSingleNode("_SortField").text
            listEmail       = xmlSource.documentElement.selectSingleNode("_ListEmail").text
            lastUpdated     = xmlSource.documentElement.selectSingleNode("DateLastUpdated").text
            updatedBy       = xmlSource.documentElement.selectSingleNode("LastUpdatedBy").text
            s = s & "<user>"     
            s = s & "<UserName>"&userName&"</UserName>"
            s = s & "<GroupName>"&groupName&"</GroupName>"                  
            s = s & "<_ExcludeUser>"&excludeUser&"</_ExcludeUser>"
            s = s & "<_SavedSearches>"&savedSearches&"</_SavedSearches>"
            s = s & "<_Preferences>"&userPreferences&"</_Preferences>"
            s = s & "<DataAccess>"&dataAccess&"</DataAccess>"
            s = s & "<_PageLength>"&pageLength&"</_PageLength>"
            s = s & "<_SortField>"&sortField&"</_SortField>"
            s = s & "<_ListEmail>"&listEmail&"</_ListEmail>"
            s = s & "<DateLastUpdated>"&lastUpdated&"</DateLastUpdated>"
            s = s & "<LastUpdatedBy>"&updatedBy&"</LastUpdatedBy>"
            s = s & "</user>"
            filename = uname & ".xml"
            set file = fso.CreateTextFile("E:\temp\" & filename) '"
            file.write s
            s = ""
            Response.Write "We have a problem! Error: " & xmlSource.parseError.Reason & "</br>"
      End If

Open in new window

Hi, change this line:
filename = uname & ".xml"

filename = username & ".xml"

You were using uname, which doesn't have any text in it....



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Try setting file to nothing after the call to close:
 Set file = Nothing
Yes, you are not setting uname on every iteration!
niidmoreAuthor Commented:
silly me ... did not really notice that i am doing this mistake ! thanks for pointing that out Rob !
No problem. Thanks for the grade.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.