Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 21st, 2004, 03:39 AM
Registered User
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default view server folder problem?

hi, all member ....
i have 2 server.......
first server is 192.168.0.10
second server is 192.168.0.57

my code inside first server..
but i want access all share folder in second server......

so, how a step i must do to fully access folder....
after run code like below, "path no found" error message display???
my code have any problem?

<%
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim rootFolder
Set rootFolder = fso.GetFolder("\\192.168.0.57")
Dim subFolders
Set subFolders = rootFolder.SubFolders
For Each folder in subFolders
response.write "<form action='showfolder.asp' method='post'>"
Response.Write folder.Name
Response.write "</form>"
Next

Set subFolders = Nothing
Set rootFolder = Nothing
Set fso = Nothing
%>



 
Old December 21st, 2004, 08:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

AFAIK, you cannot do that for a remote system using FileSystemObject. Try with WMI and VB script.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old December 21st, 2004, 09:33 AM
Authorized User
 
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your code will work on an Intranet, but your share name is has to be specified as \\server\share. This code allowed me to view subfolders on another computer on my network:

<%@ Language = VBScript %>
<%
   'Begin buffering the HTML
   'Note this MUST happen before the initial HTML tag.
   Response.Buffer = True

Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Dim rootFolder
Set rootFolder = fso.GetFolder("\\192.168.1.100\MICRONC")
Dim subFolders
Set subFolders = rootFolder.SubFolders
For Each folder in subFolders
    'Response.write "<form action='showfolder.asp' method='post'>"
    'Response.write "</form>"
    Response.Write folder.Name & "<br>"
Next
Response.End

Set subFolders = Nothing
Set rootFolder = Nothing
Set fso = Nothing
%>


Dude
 
Old December 21st, 2004, 11:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

But see to that the IUSR_MACHINENAME account has relavant permission on the remote folder. But I would suggest this not a reliable solution, if you are using ASP. A VBScript (.vbs) could work for you.

_________________________
- Vijay G
Strive for Perfection
 
Old December 21st, 2004, 10:08 PM
Registered User
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

happygv, thank your suggestion..
but i just a beginning programmer....
i dun know have to use .vbs and also don't know what is wmi....
can u teach me step by step...
thank.....







Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding a New View in Server Explorer taliesin VS.NET 2002/2003 2 March 21st, 2006 01:10 PM
Creating Folder On Server Prabhakar_dt Classic ASP Basics 1 December 29th, 2004 05:07 AM
login domain account and view a permission folder cslimcom Classic ASP Databases 0 December 22nd, 2004 10:24 PM
how to view server folder ? cslimcom VBScript 3 December 21st, 2004 10:20 PM
Problem constructing view using EM in SQL server 2 roniestein SQL Server 2000 8 November 25th, 2003 01:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.