Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 21st, 2004, 03:39 AM
Registered User
 
Join Date: Dec 2004
Location: alor setar, kedah, Malaysia.
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
%>



Reply With Quote
  #2 (permalink)  
Old December 21st, 2004, 08:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #3 (permalink)  
Old December 21st, 2004, 09:33 AM
Authorized User
 
Join Date: Dec 2004
Location: , , .
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
Reply With Quote
  #4 (permalink)  
Old December 21st, 2004, 11:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
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
Reply With Quote
  #5 (permalink)  
Old December 21st, 2004, 10:08 PM
Registered User
 
Join Date: Dec 2004
Location: alor setar, kedah, Malaysia.
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.....


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.