Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript 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
  #1 (permalink)  
Old December 21st, 2004, 02:48 AM
Registered User
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to view server folder ?

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:32 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You are using UNC syntax, so try the actual server name instead of its IP address:

'====================================
Set rootFolder = fso.GetFolder("\\ServerName\ShareName")
'====================================

In your current statement, there is no Path specified. Using ServerName and ShareName will get your path.



mmcdonal
Reply With Quote
  #3 (permalink)  
Old December 21st, 2004, 08:56 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   It occurs to me that you may have security issues with this remote access. Try mapping the drive, getting data, and unmapping like this:

'===============================
Set objNetwork = WScript.CreateObject("WScript.Network")
   objNetwork.MapNetworkDrive "x:", "\\ServerName\ShareName", _
     strUserName, strPassword

'your code here

objNetwork.RemoveNetworkDrive "x:"
'===============================

   This will allow you to access the drive with the credentials you need if your users don't have the proper credentials.

mmcdonal
Reply With Quote
  #4 (permalink)  
Old December 21st, 2004, 10:20 PM
Registered User
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank mmcdonal,
i just a beginning programmer...
can u teach me a step by step....

here, i want view all share folder for 192.168.0.57(server address)
how to i solve it.....

Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to upload folder from client to server hemaneelagiri ASP.NET 1.0 and 1.1 Professional 2 July 18th, 2007 06:10 AM
How to create a folder in server and rename files pramos.21d ASP.NET 2.0 Basics 0 April 24th, 2006 05:27 AM
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
view server folder problem? cslimcom Classic ASP Databases 4 December 21st, 2004 10:08 PM





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