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.
regards
sam
niidmoreAsked:
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.

hieloCommented:
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")
0
b0lsc0ttIT ManagerCommented:
niidmore,

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.

b0lsc0tt
0
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?
regards
sam
0
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.

hieloCommented:
If you type:
\\10.233.323.26\data\users
on explorer, can you get to the files? Not sure but you may actually have to specify the full path. Ex:
\\10.233.323.26\c$\data\users
assuming there exists:
c:\data\users
0
RobSampsonCommented:
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?

Regards,

Rob.
0
niidmoreAuthor Commented:
hello,
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\" & f.name) 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
            file.close
            s = ""
      Else
            Response.Write "We have a problem! Error: " & xmlSource.parseError.Reason & "</br>"
      End If
Next
 
%>

Open in new window

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

to
filename = username & ".xml"

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

Regards,

Rob.
0

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
hieloCommented:
Try setting file to nothing after the call to close:
...
file.close
 Set file = Nothing
0
hieloCommented:
Yes, you are not setting uname on every iteration!
0
niidmoreAuthor Commented:
silly me ... did not really notice that i am doing this mistake ! thanks for pointing that out Rob !
0
RobSampsonCommented:
No problem. Thanks for the grade.

Regards,

Rob.
0
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
ASP

From novice to tech pro — start learning today.